🎉 Welcome to the new GraphQL-ESLint website. Try new playground page →
Rules
Require Deprecation Date

require-deprecation-date

💡 This rule provides suggestions (opens in a new tab)

  • 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