✅ The "extends": "plugin:@graphql-eslint/schema-recommended"
property in a configuration file enables this rule.
- Category:
Schema
- Rule name:
@graphql-eslint/require-deprecation-reason
- Requires GraphQL Schema:
false
ℹ️ - Requires GraphQL Operations:
false
ℹ️
Require all deprecation directives to specify a reason.
# eslint @graphql-eslint/require-deprecation-reason: 'error'
type MyType {
name: String @deprecated
}
# eslint @graphql-eslint/require-deprecation-reason: 'error'
type MyType {
name: String @deprecated(reason: "")
}
# eslint @graphql-eslint/require-deprecation-reason: 'error'
type MyType {
name: String @deprecated(reason: "no longer relevant, please use fullName field")
}