Linter rulesGraphQL linter rules

GraphQL linter rules

Rulesets

Rules

RuleWhat it checksSince
argument-description-definedThis rule checks that the arguments of fields and directives have a description.0.9.0
argument-namingThis rule checks that the argument names follow a naming convention, camelCase by default.0.9.0
arguments-sortedThis rule checks that the arguments of field and directive definitions are in alphabetical order.0.9.0
custom-scalar-specified-byThis rule checks that custom scalars link their specification with @specifiedBy.0.9.0
deprecation-date-definedThis rule checks that @deprecated directives have a deletion date that has not passed.0.9.0
deprecation-reason-definedThis rule checks that @deprecated directives have a reason.0.9.0
description-capitalizedThis rule checks that descriptions start with a capital letter.0.9.0
description-styleThis rule checks that descriptions are written as block strings, or as single-line strings.0.9.0
directive-description-definedThis rule checks that directive definitions have a description.0.9.0
directive-namingThis rule checks that directive names follow a naming convention, camelCase by default.0.9.0
enum-value-description-definedThis rule checks that enum values have a description.0.9.0
enum-value-namingThis rule checks that enum value names follow a naming convention, CONST_CASE by default.0.9.0
enum-values-sortedThis rule checks that the values of each enum type definition and extension are in alphabetical order.0.9.0
field-description-definedThis rule checks that the fields of object and interface types have a description.0.9.0
field-namingThis rule checks that the field names follow a naming convention, camelCase by default.0.9.0
fields-on-correct-typeThis rule checks that the fields selected by operations are defined by their parent types.0.9.0
fields-sortedThis rule checks that the fields of each object and interface type definition and extension are in alphabetical order.0.9.0
fragment-namingThis rule checks that fragment names follow a naming convention, PascalCase by default.0.9.0
input-field-description-definedThis rule checks that the fields of input object types have a description.0.9.0
input-field-namingThis rule checks that the input field names follow a naming convention, camelCase by default.0.9.0
input-fields-sortedThis rule checks that the fields of each input object type definition and extension are in alphabetical order.0.9.0
input-no-circular-non-nullThis rule checks that input object types don't reference themselves through non-null fields.0.9.0
input-output-typesThis 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-suffixThis rule checks that input object type names end with a suffix, Input by default.0.9.0
interface-implementationThis 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-namesThis rule checks that the arguments given to fields and directives are defined by them.0.9.0
known-directive-locationsThis rule checks that directives are used at one of the locations of their definition, as the GraphQL specification requires.0.9.0
known-fragment-namesThis rule checks that fragment spreads name fragments of the document, as the GraphQL specification requires.0.9.0
known-typesThis 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-operationThis rule checks that an anonymous operation is the only operation of the document, as the GraphQL specification requires.0.9.0
lone-executable-definitionThis rule checks that a document holds a single operation or fragment.0.9.0
lone-schema-definitionThis rule checks that a document has at most one schema definition, as the GraphQL specification requires.0.9.0
match-document-filenameThis 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-argumentThis rule checks that mutation fields take a single argument, input, of a non-null input object type.0.9.0
mutation-payload-suffixThis rule checks that the result types of mutation fields end with a suffix, Payload by default.0.9.0
no-deprecatedThis rule checks that operations don't use deprecated fields, arguments and enum values.0.9.0
no-deprecated-required-argumentThis rule checks that required arguments and input fields are not deprecated.0.9.0
no-fragment-cyclesThis rule checks that fragments don't spread themselves, directly or indirectly, as the GraphQL specification requires.0.9.0
no-get-prefix-on-query-fieldsThis rule checks that the fields of the query root type are not named getSomething.0.9.0
no-hashtag-descriptionThis rule checks that definitions are documented with descriptions rather than with # comments.0.9.0
no-mixed-definitionsThis rule checks that a document holds either a schema or operations, not both.0.9.0
no-one-place-fragmentsThis rule checks that fragments are spread more than once in the document.0.9.0
no-root-typeThis rule checks that the schema doesn't have the root operation types the configuration disallows.0.9.0
no-scalar-result-on-mutationThis rule checks that mutation fields return object types rather than scalars.0.9.0
no-type-suffixThis rule checks that type names don't end with a redundant suffix such as Type or Enum.0.9.0
no-typename-prefixThis rule checks that field names don't start with the name of their type, as in User.userId.0.9.0
no-undefined-variablesThis 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-fragmentsThis 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-variablesThis rule checks that the variables defined by an operation are used, as the GraphQL specification requires.0.9.0
one-field-subscriptionsThis rule checks that subscriptions select a single root field, as the specification requires.0.9.0
oneof-fields-nullableThis rule checks that the fields of @oneOf input object types are nullable and have no default value.0.9.0
operation-known-typesThis rule checks that the types of variables and the type conditions of fragments are types of the schema.0.9.0
operation-name-definedThis rule checks that operations have names.0.9.0
operation-name-suffixThis rule checks that operation and fragment names don't end with a redundant suffix.0.9.0
operation-namingThis rule checks that operation names follow a naming convention, PascalCase by default.0.9.0
possible-type-extensionsThis rule checks that extended types have the same kind as their definition, as the GraphQL specification requires.0.9.0
query-root-definedThis rule checks that the schema has a query root operation type.0.9.0
relay-argumentsThis rule checks that fields returning connections take the pagination arguments of the Relay Cursor Connections specification.0.9.0
relay-connection-typesThis rule checks that connection types follow the Relay Cursor Connections specification.0.9.0
relay-edge-typesThis rule checks that the edge types of connections follow the Relay Cursor Connections specification.0.9.0
relay-page-infoThis rule checks that a schema with connections has a PageInfo type as the Relay Cursor Connections specification defines it.0.9.0
require-selectionsThis rule checks that selections of objects with an identifier select it.0.9.0
required-arguments-providedThis rule checks that the required arguments of fields and directives are given.0.9.0
reserved-namesThis 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-nullableThis rule checks that the fields of the query and mutation root types are nullable.0.9.0
selection-set-depthThis rule checks that selection sets are nested at most 7 levels deep.0.9.0
selections-sortedThis rule checks that the fields of each selection set of operations and fragments are in alphabetical order.0.9.0
spell-checkThis rule checks the spelling of descriptions and comments.0.9.0
strict-id-in-typesThis rule checks that object types have exactly one non-null identifier field, id: ID! by default.0.9.0
type-description-definedThis rule checks that type definitions have a description.0.9.0
type-namingThis rule checks that type names follow a naming convention, PascalCase by default.0.9.0
types-sortedThis rule checks that the type definitions of a document, and its directive definitions are in alphabetical order.0.9.0
unique-argument-definition-namesThis rule checks that the argument names of a field or directive definition are unique, as the GraphQL specification requires.0.9.0
unique-argument-namesThis rule checks that the argument names of a field or directive are unique, as the GraphQL specification requires.0.9.0
unique-directive-namesThis rule checks that directive names are unique, as the GraphQL specification requires.0.9.0
unique-directives-per-locationThis rule checks that non-repeatable directives are used once per location, as the GraphQL specification requires.0.9.0
unique-enum-value-namesThis 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-namesThis 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-namesThis rule checks that fragment names are unique, as the GraphQL specification requires.0.9.0
unique-input-field-namesThis rule checks that the field names of an object value are unique, as the GraphQL specification requires.0.9.0
unique-operation-namesThis rule checks that operation names are unique, as the GraphQL specification requires.0.9.0
unique-operation-typesThis 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-namesThis rule checks that type names are unique, as the GraphQL specification requires.0.9.0
unique-variable-namesThis rule checks that the variable names of an operation are unique, as the GraphQL specification requires.0.9.0
unreachable-typesThis rule checks that every type is reachable from the root operation types.0.9.0
unused-directive-definitionThis rule checks that the directives defined for schemas are applied in the document.0.9.0
variables-sortedThis rule checks that the variable definitions of each operation are in alphabetical order.0.9.0