require-description
Enforce descriptions in type definitions and operations.
✅ The "extends": "plugin:@graphql-eslint/schema-recommended" property in a configuration file
enables this rule.
- Category:
Schema - Rule name:
@graphql-eslint/require-description - Requires GraphQL Schema:
falseℹ️ - Requires GraphQL Operations:
falseℹ️
Enforce descriptions in type definitions and operations.
Usage Examples
Incorrect
Correct
Correct
Correct
Correct
Config Schema
The schema defines the following properties:
types (boolean, enum)
Includes:
ObjectTypeDefinitionInterfaceTypeDefinitionEnumTypeDefinitionScalarTypeDefinitionInputObjectTypeDefinitionUnionTypeDefinition
This element must be one of the following enum values:
true
rootField (boolean, enum)
Definitions within Query, Mutation, and Subscription root types.
This element must be one of the following enum values:
true
ignoredSelectors (array)
Ignore specific selectors
[!TIP]
These fields are defined by ESLint
selectors. Paste or drop code into the editor in ASTExplorer and inspect the generated AST to compose your selector.
The object is an array with all elements of the type string.
Additional restrictions:
- Minimum items:
1 - Unique items:
true
DirectiveDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
EnumTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
EnumValueDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
FieldDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
InputObjectTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
InputValueDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
InterfaceTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
ObjectTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
OperationDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
[!WARNING]
You must use only comment syntax
#and not description syntax"""or".
ScalarTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.
UnionTypeDefinition (boolean)
[!NOTE]
Read more about this kind on spec.graphql.org.