ESLint plugin for validating GraphQL schema definitions with rules for descriptions, naming conventions, ordering, and required patterns. Version 2.0.3 is the latest stable release, updated as needed via GitHub. Key differentiators: focused solely on schema validation (not operations), supports .graphql and .gql file extensions, and provides a custom parser for direct linting. Includes 15 rules covering arguments, enums, input objects, and object types.
npm install eslint-plugin-graphql-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures ESLint with the graphql-schema plugin and custom parser for .graphql files, with example schema that complies with rules.
Ensure ESLint version is 6 or higher and Node version is 12 or higher.
Add 'parser': 'eslint-plugin-graphql-schema/parser' in ESLint config overrides for .graphql files.
Reference rules as 'graphql-schema/rule-name' in ESLint config.
Use eslint-plugin-graphql for operation validation.
Check documentation; use 'type-fields-have-descriptions' or 'input-object-values-have-descriptions' as appropriate.
Run 'npm install eslint-plugin-graphql-schema --save-dev' and ensure the parser is written exactly as 'eslint-plugin-graphql-schema/parser'.
Use strings: "graphql-schema/arguments-have-descriptions": "off".
Ensure the 'parser' is set correctly and the file has a schema definition (e.g., type Query { ... }).