selection-set-depth
Limit the complexity of the GraphQL operations solely by their depth. Based on graphql-depth-limit.
✅ The "extends": "plugin:@graphql-eslint/operations-recommended" property in a configuration file
enables this rule.
💡 This rule provides suggestions
- Category:
Operations - Rule name:
@graphql-eslint/selection-set-depth - Requires GraphQL Schema:
falseℹ️ - Requires GraphQL Operations:
trueℹ️
Limit the complexity of the GraphQL operations solely by their depth. Based on graphql-depth-limit.
Usage Examples
Incorrect
Correct
Correct (ignored field)
Config Schema
The schema defines the following properties:
maxDepth (number, required)
ignore (array)
The object is an array with all elements of the type string.
Additional restrictions:
- Minimum items:
1 - Unique items:
true