Because documentation for GraphQL schemas are usually auto-generated omitting descriptions will not provide any information about types in your schema. It's considered best practice to provide descriptions for all your type definitions.
This rule requires descriptions to be present in your type definitions files.
Examples of incorrect code for this rule:
# eslint @graphql-eslint/require-description: ["error", { types: true, fields: true }]
type someTypeName {
name: String
}
Examples of correct code for this rule:
# eslint @graphql-eslint/require-description: ["error", { types: true, fields: true }]
""" Some type description """
type someTypeName {
""" Name description """
name: String
}
This rule accetps an configuration object with four options:
"types": boolean
- Requires descriptions for all types. Defaults totrue
"fields": boolean
- Requires descriptions for all fields. Defaults totrue
"enumValues": boolean
- Requires descriptions for all enum values. Defaults totrue
"inputOptionsValues": boolean
- Requires descriptions for all input properties. Defaults totrue