useNamedOperation
Diagnostic Category: lint/nursery/useNamedOperation
Since: vnext
Sources:
- Same as:
graphql/no-anonymous-operations
Description
Section titled DescriptionEnforce specifying the name of GraphQL operations.
This is useful because most GraphQL client libraries use the operation name for caching purposes.
Examples
Section titled ExamplesInvalid
Section titled Invalidquery {}
Valid
Section titled Validquery Human { name}
How to configure
Section titled How to configure{ "linter": { "rules": { "nursery": { "useNamedOperation": "error" } } }}