On this page

Shared Configs

Shared Configs — GraphQL ESLint documentation.

Schema Configs

NameDescription
flat/schema-recommendedenables recommended rules for schema development
flat/schema-allenables all rules for schema development, except for those that require parserOptions.operations option
flat/schema-relayenables rules from Relay specification for schema development

Operations Configs

NameDescription
flat/operations-recommendedenables recommended rules for consuming GraphQL (operations) development
flat/operations-allenables all rules for consuming GraphQL (operations) development

Config Usage

For example, to enable the flat/schema-recommended config, in a new configuration object assign the rules field to the rules field from the associated config from graphqlPlugin.configs object.

eslint.config.js
import graphqlPlugin from '@graphql-eslint/eslint-plugin'

export default [
  // ... other config
  {
    files: ['**/*.graphql'],
    languageOptions: {
      parser: graphqlPlugin.parser
    },
    plugins: {
      '@graphql-eslint': graphqlPlugin
    }
  },
+ {
+   files: ['path-to-schema/**/*.graphql'],
+   rules: graphqlPlugin.configs['flat/schema-recommended'].rules
+ }
]