When writing a GraphQL schema with the Schema Definition Language, some flexibility, such as
adding a deprecationReason
to a field is lost. This package implements a custom directive
to make it possible to deprecate a field or enum. This is intended for use in Apollo Server that builds the schema with graphql-tools. See the Apollo graphql-tools docs for more information on schema directives.
Usage
npm install graphql-directive-deprecated
Example
;; const typeDefs = ` directive @deprecated( reason: String = "No longer supported" ) on FIELD_DEFINITION | ENUM_VALUE type ExampleType { newField: String oldField: String @deprecated(reason: "Use newField.") }`; const schema = ;