Skip to content

Files

Latest commit

a69f0be · Nov 21, 2021

History

History
37 lines (25 loc) · 999 Bytes

no-anonymous-operations.md

File metadata and controls

37 lines (25 loc) · 999 Bytes

no-anonymous-operations

✅ The "extends": "plugin:@graphql-eslint/operations-recommended" property in a configuration file enables this rule.

  • Category: Operations
  • Rule name: @graphql-eslint/no-anonymous-operations
  • Requires GraphQL Schema: false ℹ️
  • Requires GraphQL Operations: false ℹ️

Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes.

Usage Examples

Incorrect

# eslint @graphql-eslint/no-anonymous-operations: 'error'

query {
  # ...
}

Correct

# eslint @graphql-eslint/no-anonymous-operations: 'error'

query user {
  # ...
}

Resources