An ESLint plugin that validates GraphQL query strings against a schema in JavaScript and .graphql files.
eslint-plugin-graphql is an ESLint plugin that validates GraphQL query strings—whether in JavaScript template literals or standalone `.graphql` files—against a provided GraphQL schema. It catches errors early in development by ensuring queries are syntactically correct and match the schema's structure, improving code reliability and developer experience.
Developers using GraphQL with clients like Apollo, Relay, Lokka, or FraQL, who want to integrate GraphQL validation into their existing ESLint workflow without separate tooling.
It provides seamless integration with ESLint, offering built-in configurations for multiple GraphQL clients, support for multiple schemas, and customizable validation rules, all while working with `.graphqlconfig` files for schema management.
:vertical_traffic_light: Check your GraphQL query strings against a schema.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides built-in configurations for Apollo, Relay, Lokka, FraQL, and literal files, reducing setup time for various GraphQL clients.
Accepts schemas via JSON, file paths, or schema strings, and integrates with .graphqlconfig files for centralized schema management.
Allows fine-grained control over GraphQL validators, enabling enforcement of rules like named operations or no deprecated fields as shown in the README examples.
Supports validation against multiple schemas using different tags in the same project, useful for applications interacting with multiple GraphQL systems.
The README includes a 2022 deprecation note from Apollo, recommending migration to graphql-eslint, which poses a risk for long-term project stability.
Configuration requires careful schema provisioning, with options like schemaJsonFilepath being incompatible with eslint --cache, leading to potential caching issues.
Relies on template literal tags for query identification, forcing the use of workarounds like fake-tag for clients without tags, adding unnecessary boilerplate.