Hi, I try to implement register functionality in FaunaDB.
At least there are two cases of the response.
The first one is success and the second one is unique error.
If user try to register username that already exists in the database, the current response of FaunaDB graphql endpoint is the following:
{
"errors": [
{
"message": "Instance is not unique.",
"extensions": {
"code": "instance not unique"
}
}
]
}
Currently I use errors[0].message == "Instance is not unique"
in my code to rerender the form with the error message.
My question is: How to make sure if there is an unique error, errors[0].message
is always "Instance is not unique"
?
I remember that previously the error message is Document is not unique
.
If changes happen in FaunaDB this obviously will break my application.
Thank you.