# GraphQL ESLint > An ESLint parser, plugin and rule set for GraphQL: lints .graphql files and GraphQL in code files, validates schemas and operations against the spec, and enforces naming, description and Relay conventions. ## Documentation - [Introduction](https://the-guild.dev/graphql/eslint/docs.md): What's GraphQL-ESLint, key features and helpful resources. - [Usage](https://the-guild.dev/graphql/eslint/docs/usage.md) - [GraphQL Files](https://the-guild.dev/graphql/eslint/docs/usage/graphql.md) - [Code Files](https://the-guild.dev/graphql/eslint/docs/usage/js.md) - [Schema and Operations](https://the-guild.dev/graphql/eslint/docs/usage/schema-and-operations.md) - [Multiple Projects](https://the-guild.dev/graphql/eslint/docs/usage/multiple-projects.md) - [Programmatic](https://the-guild.dev/graphql/eslint/docs/usage/programmatic.md) - [Svelte](https://the-guild.dev/graphql/eslint/docs/usage/svelte.md) - [Vue](https://the-guild.dev/graphql/eslint/docs/usage/vue.md) - [Astro](https://the-guild.dev/graphql/eslint/docs/usage/astro.md) - [Prettier](https://the-guild.dev/graphql/eslint/docs/usage/prettier.md) - [Custom GraphQL Rules](https://the-guild.dev/graphql/eslint/docs/usage/custom-rules.md) - [Shared Configs](https://the-guild.dev/graphql/eslint/docs/configs.md) - [Disabling Rules](https://the-guild.dev/graphql/eslint/docs/disabling-rules.md) - [VSCode Integration](https://the-guild.dev/graphql/eslint/docs/vscode.md) - [How Does a Parser Work?](https://the-guild.dev/graphql/eslint/docs/parser.md) - [Writing Custom Rules](https://the-guild.dev/graphql/eslint/docs/custom-rules.md) ## Rules - [Overview](https://the-guild.dev/graphql/eslint/rules.md): Every GraphQL-ESLint rule, with the configs that enable it and what it applies to. - [prettier Rule](https://the-guild.dev/graphql/eslint/rules/prettier.md) - [Deprecated Rules](https://the-guild.dev/graphql/eslint/rules/deprecated-rules.md) - [alphabetize](https://the-guild.dev/graphql/eslint/rules/alphabetize.md): Enforce arrange in alphabetical order for type fields, enum values, input object fields, operation selections and more. - [known-argument-names](https://the-guild.dev/graphql/eslint/rules/known-argument-names.md): A GraphQL field is only valid if all supplied arguments are defined by that field. - [known-directives](https://the-guild.dev/graphql/eslint/rules/known-directives.md): A GraphQL document is only valid if all `@directive`s are known by the schema and legally positioned. - [known-type-names](https://the-guild.dev/graphql/eslint/rules/known-type-names.md): A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema. - [naming-convention](https://the-guild.dev/graphql/eslint/rules/naming-convention.md): Require names to follow specified conventions. - [provided-required-arguments](https://the-guild.dev/graphql/eslint/rules/provided-required-arguments.md): A field or directive is only valid if all required (non-null without a default value) field arguments have been provided. - [unique-directive-names-per-location](https://the-guild.dev/graphql/eslint/rules/unique-directive-names-per-location.md): A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named. - [description-style](https://the-guild.dev/graphql/eslint/rules/description-style.md): Require all comments to follow the same style (either block or inline). - [input-name](https://the-guild.dev/graphql/eslint/rules/input-name.md): Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". - [lone-schema-definition](https://the-guild.dev/graphql/eslint/rules/lone-schema-definition.md): A GraphQL document is only valid if it contains only one schema definition. - [no-hashtag-description](https://the-guild.dev/graphql/eslint/rules/no-hashtag-description.md): Requires to use `"""` or `"` for adding a GraphQL description instead of `#`. - [no-root-type](https://the-guild.dev/graphql/eslint/rules/no-root-type.md): Disallow using root types `mutation` and/or `subscription`. - [no-scalar-result-type-on-mutation](https://the-guild.dev/graphql/eslint/rules/no-scalar-result-type-on-mutation.md): Avoid scalar result type on mutation type to make sure to return a valid state. - [no-typename-prefix](https://the-guild.dev/graphql/eslint/rules/no-typename-prefix.md): Enforces users to avoid using the type name in a field name while defining your schema. - [no-unreachable-types](https://the-guild.dev/graphql/eslint/rules/no-unreachable-types.md): Requires all types to be reachable at some level by root level fields. - [no-unused-fields](https://the-guild.dev/graphql/eslint/rules/no-unused-fields.md): Requires all fields to be used at some level by siblings operations. - [possible-type-extension](https://the-guild.dev/graphql/eslint/rules/possible-type-extension.md): A type extension is only valid if the type is defined and has the same kind. - [relay-arguments](https://the-guild.dev/graphql/eslint/rules/relay-arguments.md): Set of rules to follow Relay specification for Arguments. - [relay-connection-types](https://the-guild.dev/graphql/eslint/rules/relay-connection-types.md): Set of rules to follow Relay specification for Connection types. - [relay-edge-types](https://the-guild.dev/graphql/eslint/rules/relay-edge-types.md): Set of rules to follow Relay specification for Edge types. - [relay-page-info](https://the-guild.dev/graphql/eslint/rules/relay-page-info.md): Set of rules to follow Relay specification for `PageInfo` object. - [require-deprecation-date](https://the-guild.dev/graphql/eslint/rules/require-deprecation-date.md): Require deletion date on `@deprecated` directive. Suggest removing deprecated things after deprecated date. - [require-deprecation-reason](https://the-guild.dev/graphql/eslint/rules/require-deprecation-reason.md): Require all deprecation directives to specify a reason. - [require-description](https://the-guild.dev/graphql/eslint/rules/require-description.md): Enforce descriptions in type definitions and operations. - [require-field-of-type-query-in-mutation-result](https://the-guild.dev/graphql/eslint/rules/require-field-of-type-query-in-mutation-result.md): Allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application. - [require-nullable-fields-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-nullable-fields-with-oneof.md): Require `input` or `type` fields to be non-nullable with `@oneOf` directive. - [require-nullable-result-in-root](https://the-guild.dev/graphql/eslint/rules/require-nullable-result-in-root.md): Require nullable fields in root types. - [require-type-pattern-with-oneof](https://the-guild.dev/graphql/eslint/rules/require-type-pattern-with-oneof.md): Enforce types with `@oneOf` directive have `error` and `ok` fields. - [strict-id-in-types](https://the-guild.dev/graphql/eslint/rules/strict-id-in-types.md): Requires output types to have one unique identifier unless they do not have a logical one. Exceptions can be used to ignore output types that do not have unique identifiers. - [unique-directive-names](https://the-guild.dev/graphql/eslint/rules/unique-directive-names.md): A GraphQL document is only valid if all defined directives have unique names. - [unique-enum-value-names](https://the-guild.dev/graphql/eslint/rules/unique-enum-value-names.md): A GraphQL enum type is only valid if all its values are uniquely named. - [unique-field-definition-names](https://the-guild.dev/graphql/eslint/rules/unique-field-definition-names.md): A GraphQL complex type is only valid if all its fields are uniquely named. - [unique-operation-types](https://the-guild.dev/graphql/eslint/rules/unique-operation-types.md): A GraphQL document is only valid if it has only one type per operation. - [unique-type-names](https://the-guild.dev/graphql/eslint/rules/unique-type-names.md): A GraphQL document is only valid if all defined types have unique names. - [executable-definitions](https://the-guild.dev/graphql/eslint/rules/executable-definitions.md): A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions. - [fields-on-correct-type](https://the-guild.dev/graphql/eslint/rules/fields-on-correct-type.md): A GraphQL document is only valid if all fields selected are defined by the parent type, or are an allowed meta field such as `__typename`. - [fragments-on-composite-type](https://the-guild.dev/graphql/eslint/rules/fragments-on-composite-type.md): Fragments use a type condition to determine if they apply, since fragments can only be spread into a composite type (object, interface, or union), the type condition must also be a composite type. - [known-fragment-names](https://the-guild.dev/graphql/eslint/rules/known-fragment-names.md): A GraphQL document is only valid if all `...Fragment` fragment spreads refer to fragments defined in the same document. - [lone-anonymous-operation](https://the-guild.dev/graphql/eslint/rules/lone-anonymous-operation.md): A GraphQL document that contains an anonymous operation (the `query` short-hand) is only valid if it contains only that one operation definition. - [lone-executable-definition](https://the-guild.dev/graphql/eslint/rules/lone-executable-definition.md): Require queries, mutations, subscriptions or fragments to be located in separate files. - [match-document-filename](https://the-guild.dev/graphql/eslint/rules/match-document-filename.md): This rule allows you to enforce that the file name should match the operation name. - [no-anonymous-operations](https://the-guild.dev/graphql/eslint/rules/no-anonymous-operations.md): Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes. - [no-deprecated](https://the-guild.dev/graphql/eslint/rules/no-deprecated.md): Enforce that deprecated fields or enum values are not in use by operations. - [no-duplicate-fields](https://the-guild.dev/graphql/eslint/rules/no-duplicate-fields.md): Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field. - [no-fragment-cycles](https://the-guild.dev/graphql/eslint/rules/no-fragment-cycles.md): A GraphQL fragment is only valid when it does not have cycles in fragments usage. - [no-one-place-fragments](https://the-guild.dev/graphql/eslint/rules/no-one-place-fragments.md): Disallow fragments that are used only in one place. - [no-undefined-variables](https://the-guild.dev/graphql/eslint/rules/no-undefined-variables.md): A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation. - [no-unused-fragments](https://the-guild.dev/graphql/eslint/rules/no-unused-fragments.md): A GraphQL document is only valid if all fragment definitions are spread within operations, or spread within other fragments spread within operations. - [no-unused-variables](https://the-guild.dev/graphql/eslint/rules/no-unused-variables.md): A GraphQL operation is only valid if all variables defined by an operation are used, either directly or within a spread fragment. - [one-field-subscriptions](https://the-guild.dev/graphql/eslint/rules/one-field-subscriptions.md): A GraphQL subscription is valid only if it contains a single root field. - [overlapping-fields-can-be-merged](https://the-guild.dev/graphql/eslint/rules/overlapping-fields-can-be-merged.md): A selection set is only valid if all fields (including spreading any fragments) either correspond to distinct response names or can be merged without ambiguity. - [possible-fragment-spread](https://the-guild.dev/graphql/eslint/rules/possible-fragment-spread.md): A fragment spread is only valid if the type condition could ever possibly be true: if there is a non-empty intersection of the possible parent types, and possible types which pass the type condition. - [require-import-fragment](https://the-guild.dev/graphql/eslint/rules/require-import-fragment.md): Require fragments to be imported via an import expression. - [require-selections](https://the-guild.dev/graphql/eslint/rules/require-selections.md): Enforce selecting specific fields when they are available on the GraphQL type. - [scalar-leafs](https://the-guild.dev/graphql/eslint/rules/scalar-leafs.md): A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types. - [selection-set-depth](https://the-guild.dev/graphql/eslint/rules/selection-set-depth.md): Limit the complexity of the GraphQL operations solely by their depth. Based on graphql-depth-limit. - [unique-argument-names](https://the-guild.dev/graphql/eslint/rules/unique-argument-names.md): A GraphQL field or directive is only valid if all supplied arguments are uniquely named. - [unique-fragment-name](https://the-guild.dev/graphql/eslint/rules/unique-fragment-name.md): Enforce unique fragment names across your project. - [unique-input-field-names](https://the-guild.dev/graphql/eslint/rules/unique-input-field-names.md): A GraphQL input object value is only valid if all supplied fields are uniquely named. - [unique-operation-name](https://the-guild.dev/graphql/eslint/rules/unique-operation-name.md): Enforce unique operation names across your project. - [unique-variable-names](https://the-guild.dev/graphql/eslint/rules/unique-variable-names.md): A GraphQL operation is only valid if all its variables are uniquely named. - [value-literals-of-correct-type](https://the-guild.dev/graphql/eslint/rules/value-literals-of-correct-type.md): A GraphQL document is only valid if all value literals are of the type expected at their position. - [variables-are-input-types](https://the-guild.dev/graphql/eslint/rules/variables-are-input-types.md): A GraphQL operation is only valid if all the variables it defines are of input types (scalar, enum, or input object). - [variables-in-allowed-position](https://the-guild.dev/graphql/eslint/rules/variables-in-allowed-position.md): Variables passed to field arguments conform to type. ## Changelog