src/content/docs/linter/rules/use-deprecated-reason.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="GraphQL" icon="seti:graphql"> ## Summary - Rule available since: `v1.9.0` - Diagnostic Category: [`lint/style/useDeprecatedReason`](/reference/diagnostics#diagnostic-category) - This rule is **recommended**, meaning it is enabled by default. - This rule doesn't have a fix. - The default severity of this rule is [**warning**](/reference/diagnostics#warning). - Sources: - Same as [`@graphql-eslint/require-deprecation-reason`](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason){
"linter": {
"rules": {
"style": {
"useDeprecatedReason": "error"
}
}
}
}
Require specifying the reason argument when using @deprecated directive
This rule checks the parameter of @deprecated directive for the use of reason argument,
suggesting user to add it in case the argument is missing.
query {
member @deprecated
}
query {
member @deprecated(reason: "Why?")
}