How to make sure that GraphQL endpoint response doesn't change in the future?

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.

I think you ideally verify the code, not the message. I would assume (not sure, did not verify this with the core team yet) that the message is meant to be human readable and the code is meant to stay consistent.

Got it. I will use the code instead of the message.