Linter rulesGraphQL linter rules
GraphQL linter rules
Rulesets
Rules
| Rule | What it checks | Since |
|---|---|---|
argument-description-defined | This rule checks that the arguments of fields and directives have a description. | 0.9.0 |
argument-naming | This rule checks that the argument names follow a naming convention, camelCase by default. | 0.9.0 |
arguments-sorted | This rule checks that the arguments of field and directive definitions are in alphabetical order. | 0.9.0 |
custom-scalar-specified-by | This rule checks that custom scalars link their specification with @specifiedBy. | 0.9.0 |
deprecation-date-defined | This rule checks that @deprecated directives have a deletion date that has not passed. | 0.9.0 |
deprecation-reason-defined | This rule checks that @deprecated directives have a reason. | 0.9.0 |
description-capitalized | This rule checks that descriptions start with a capital letter. | 0.9.0 |
description-style | This rule checks that descriptions are written as block strings, or as single-line strings. | 0.9.0 |
directive-description-defined | This rule checks that directive definitions have a description. | 0.9.0 |
directive-naming | This rule checks that directive names follow a naming convention, camelCase by default. | 0.9.0 |
enum-value-description-defined | This rule checks that enum values have a description. | 0.9.0 |
enum-value-naming | This rule checks that enum value names follow a naming convention, CONST_CASE by default. | 0.9.0 |
enum-values-sorted | This rule checks that the values of each enum type definition and extension are in alphabetical order. | 0.9.0 |
field-description-defined | This rule checks that the fields of object and interface types have a description. | 0.9.0 |
field-naming | This rule checks that the field names follow a naming convention, camelCase by default. | 0.9.0 |
fields-on-correct-type | This rule checks that the fields selected by operations are defined by their parent types. | 0.9.0 |
fields-sorted | This rule checks that the fields of each object and interface type definition and extension are in alphabetical order. | 0.9.0 |
fragment-naming | This rule checks that fragment names follow a naming convention, PascalCase by default. | 0.9.0 |
input-field-description-defined | This rule checks that the fields of input object types have a description. | 0.9.0 |
input-field-naming | This rule checks that the input field names follow a naming convention, camelCase by default. | 0.9.0 |
input-fields-sorted | This rule checks that the fields of each input object type definition and extension are in alphabetical order. | 0.9.0 |
input-no-circular-non-null | This rule checks that input object types don't reference themselves through non-null fields. | 0.9.0 |
input-output-types | This rule checks that arguments and input fields have input types, and fields have output types, as the GraphQL specification requires. | 0.9.0 |
input-type-suffix | This rule checks that input object type names end with a suffix, Input by default. | 0.9.0 |
interface-implementation | This rule checks that object and interface types implement their interfaces with all their fields, compatible field types and matching arguments, as the GraphQL specification requires. | 0.9.0 |
known-argument-names | This rule checks that the arguments given to fields and directives are defined by them. | 0.9.0 |
known-directive-locations | This rule checks that directives are used at one of the locations of their definition, as the GraphQL specification requires. | 0.9.0 |
known-fragment-names | This rule checks that fragment spreads name fragments of the document, as the GraphQL specification requires. | 0.9.0 |
known-types | This rule checks that the types referenced by type system definitions are built-in scalars or defined in the document, as the GraphQL specification requires. | 0.9.0 |
lone-anonymous-operation | This rule checks that an anonymous operation is the only operation of the document, as the GraphQL specification requires. | 0.9.0 |
lone-executable-definition | This rule checks that a document holds a single operation or fragment. | 0.9.0 |
lone-schema-definition | This rule checks that a document has at most one schema definition, as the GraphQL specification requires. | 0.9.0 |
match-document-filename | This rule checks that the file name of a document with one operation or fragment is the name of the definition. | 0.9.0 |
mutation-input-argument | This rule checks that mutation fields take a single argument, input, of a non-null input object type. | 0.9.0 |
mutation-payload-suffix | This rule checks that the result types of mutation fields end with a suffix, Payload by default. | 0.9.0 |
no-deprecated | This rule checks that operations don't use deprecated fields, arguments and enum values. | 0.9.0 |
no-deprecated-required-argument | This rule checks that required arguments and input fields are not deprecated. | 0.9.0 |
no-fragment-cycles | This rule checks that fragments don't spread themselves, directly or indirectly, as the GraphQL specification requires. | 0.9.0 |
no-get-prefix-on-query-fields | This rule checks that the fields of the query root type are not named getSomething. | 0.9.0 |
no-hashtag-description | This rule checks that definitions are documented with descriptions rather than with # comments. | 0.9.0 |
no-mixed-definitions | This rule checks that a document holds either a schema or operations, not both. | 0.9.0 |
no-one-place-fragments | This rule checks that fragments are spread more than once in the document. | 0.9.0 |
no-root-type | This rule checks that the schema doesn't have the root operation types the configuration disallows. | 0.9.0 |
no-scalar-result-on-mutation | This rule checks that mutation fields return object types rather than scalars. | 0.9.0 |
no-type-suffix | This rule checks that type names don't end with a redundant suffix such as Type or Enum. | 0.9.0 |
no-typename-prefix | This rule checks that field names don't start with the name of their type, as in User.userId. | 0.9.0 |
no-undefined-variables | This rule checks that the variables used by an operation, including in the fragments it spreads, are defined by the operation, as the GraphQL specification requires. | 0.9.0 |
no-unused-fragments | This rule checks that every fragment is spread by an operation, directly or through other fragments, as the GraphQL specification requires. | 0.9.0 |
no-unused-variables | This rule checks that the variables defined by an operation are used, as the GraphQL specification requires. | 0.9.0 |
one-field-subscriptions | This rule checks that subscriptions select a single root field, as the specification requires. | 0.9.0 |
oneof-fields-nullable | This rule checks that the fields of @oneOf input object types are nullable and have no default value. | 0.9.0 |
operation-known-types | This rule checks that the types of variables and the type conditions of fragments are types of the schema. | 0.9.0 |
operation-name-defined | This rule checks that operations have names. | 0.9.0 |
operation-name-suffix | This rule checks that operation and fragment names don't end with a redundant suffix. | 0.9.0 |
operation-naming | This rule checks that operation names follow a naming convention, PascalCase by default. | 0.9.0 |
possible-type-extensions | This rule checks that extended types have the same kind as their definition, as the GraphQL specification requires. | 0.9.0 |
query-root-defined | This rule checks that the schema has a query root operation type. | 0.9.0 |
relay-arguments | This rule checks that fields returning connections take the pagination arguments of the Relay Cursor Connections specification. | 0.9.0 |
relay-connection-types | This rule checks that connection types follow the Relay Cursor Connections specification. | 0.9.0 |
relay-edge-types | This rule checks that the edge types of connections follow the Relay Cursor Connections specification. | 0.9.0 |
relay-page-info | This rule checks that a schema with connections has a PageInfo type as the Relay Cursor Connections specification defines it. | 0.9.0 |
require-selections | This rule checks that selections of objects with an identifier select it. | 0.9.0 |
required-arguments-provided | This rule checks that the required arguments of fields and directives are given. | 0.9.0 |
reserved-names | This rule checks that the names of types, fields, arguments, enum values and directives don't start with "__", as the GraphQL specification requires. | 0.9.0 |
root-fields-nullable | This rule checks that the fields of the query and mutation root types are nullable. | 0.9.0 |
selection-set-depth | This rule checks that selection sets are nested at most 7 levels deep. | 0.9.0 |
selections-sorted | This rule checks that the fields of each selection set of operations and fragments are in alphabetical order. | 0.9.0 |
spell-check | This rule checks the spelling of descriptions and comments. | 0.9.0 |
strict-id-in-types | This rule checks that object types have exactly one non-null identifier field, id: ID! by default. | 0.9.0 |
type-description-defined | This rule checks that type definitions have a description. | 0.9.0 |
type-naming | This rule checks that type names follow a naming convention, PascalCase by default. | 0.9.0 |
types-sorted | This rule checks that the type definitions of a document, and its directive definitions are in alphabetical order. | 0.9.0 |
unique-argument-definition-names | This rule checks that the argument names of a field or directive definition are unique, as the GraphQL specification requires. | 0.9.0 |
unique-argument-names | This rule checks that the argument names of a field or directive are unique, as the GraphQL specification requires. | 0.9.0 |
unique-directive-names | This rule checks that directive names are unique, as the GraphQL specification requires. | 0.9.0 |
unique-directives-per-location | This rule checks that non-repeatable directives are used once per location, as the GraphQL specification requires. | 0.9.0 |
unique-enum-value-names | This rule checks that the values of an enum are unique across the enum and its extensions, as the GraphQL specification requires. | 0.9.0 |
unique-field-definition-names | This rule checks that the field names of a type are unique across the type and its extensions, as the GraphQL specification requires. | 0.9.0 |
unique-fragment-names | This rule checks that fragment names are unique, as the GraphQL specification requires. | 0.9.0 |
unique-input-field-names | This rule checks that the field names of an object value are unique, as the GraphQL specification requires. | 0.9.0 |
unique-operation-names | This rule checks that operation names are unique, as the GraphQL specification requires. | 0.9.0 |
unique-operation-types | This rule checks that each root operation type is defined once across the schema definition and its extensions, as the GraphQL specification requires. | 0.9.0 |
unique-type-names | This rule checks that type names are unique, as the GraphQL specification requires. | 0.9.0 |
unique-variable-names | This rule checks that the variable names of an operation are unique, as the GraphQL specification requires. | 0.9.0 |
unreachable-types | This rule checks that every type is reachable from the root operation types. | 0.9.0 |
unused-directive-definition | This rule checks that the directives defined for schemas are applied in the document. | 0.9.0 |
variables-sorted | This rule checks that the variable definitions of each operation are in alphabetical order. | 0.9.0 |