Gato GraphQL logo

Deprecation Notifier

Deprecation Notifier

Whenever a deprecated field is queried, a deprecation message is returned in that same GraphQL response, under the top-level entry extensions.

This alerts users of our APIs to upgrade their use of the schema, even when they are not paying attention to the introspection query.

For instance, running this query, where field isPublished is deprecated:

query {
  posts {
    title
    isPublished
  }
}

...will produce this response:

{
  "extensions": {
    "deprecations": [
      {
        "message": "Use 'isStatus(status:published)' instead of 'isPublished'",
        "extensions": {
          ...
        }
      }
    ]
  },
  "data": {
    "posts": [
      ...
    ]
  }
}