Skip to Content
🚧 This is WIP documentation for v4 of the plugin. For v3 click here.
ESLGraphQL-ESLint
Rulesrequire-deprecation-date

require-deprecation-date

💡 This rule provides suggestions

  • Category: Schema
  • Rule name: @graphql-eslint/require-deprecation-date
  • Requires GraphQL Schema: false ℹ️
  • Requires GraphQL Operations: false ℹ️
Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date.

Usage Examples

Incorrect

# eslint @graphql-eslint/require-deprecation-date: 'error'
 
type User {
  firstname: String @deprecated
  firstName: String
}

Incorrect

# eslint @graphql-eslint/require-deprecation-date: 'error'
 
type User {
  firstname: String @deprecated(reason: "Use 'firstName' instead")
  firstName: String
}

Correct

# eslint @graphql-eslint/require-deprecation-date: 'error'
 
type User {
  firstname: String @deprecated(reason: "Use 'firstName' instead", deletionDate: "25/12/2022")
  firstName: String
}

Config Schema

The schema defines the following properties:

argumentName (string)

Resources

Last updated on