dimaMachina / graphql-eslint

ESLint parser, plugin and set rules for GraphQL (for schema and operations). Easily customizable with custom rules. Integrates with IDEs and modern GraphQL tools.
https://the-guild.dev/graphql/eslint
MIT License
779 stars 101 forks source link

Support deprecated input values #2415

Open jhalborg opened 1 week ago

jhalborg commented 1 week ago

Is your feature request related to a problem? Please describe.

If the schema deprecates input values (args, input fields) the linter will complain with the error

Parsing error: [graphql-eslint] Error while loading schema: Directive "@deprecated" may not be used on INPUT_FIELD_DEFINITION.

Describe the solution you'd like

No error, as deprecated input values are allowed in GraphQL

Describe alternatives you've considered

--

Additional context

"@graphql-eslint/eslint-plugin": "^3.20.1",

Schema sample:

type Query {
  controlStates(id: ID!, Hierarchy: Hierarchy @deprecated(reason: "No longer required, info is retrieved based on device id")): Device
}
dimaMachina commented 6 days ago

https://github.com/dimaMachina/graphql-eslint/issues/1891#issuecomment-1734533636