Deprecated
GraphQL supports marking fields, input fields, arguments and enum values as @deprecated with an optional reason. These directives are used by tools like Graphiql and editor integrations to provide context to developers.
Grats supports this feature by using the @deprecated JSDoc tag. This tag can be used on fields, enum variants, and arguments. If the tag is followed by text, that text is used as the reason for the deprecation.
Field example
/** @gqlType */
class Query {
/**
* @gqlField
* @deprecated Please use myNewField instead.
*/
oldField: string;
/** @gqlField */
newField: string;
}
Would extract:
type Query {
oldField: String @deprecated(reason: "Please use myNewField instead.")
newField: String
}