Skip to content

Latest commit

 

History

History
75 lines (70 loc) · 9.87 KB

README.md

File metadata and controls

75 lines (70 loc) · 9.87 KB

Available Rules

Each rule has emojis denoting:

  • 🚀 graphql-eslint rule
  • 🔮 graphql-js rule
  • 🔧 if some problems reported by the rule are automatically fixable by the --fix command line option
  • ✅ if it belongs to the recommended configuration
Name                     Description 🚀 / 🔮 🔧
avoid-duplicate-fields Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field. 🚀
avoid-operation-name-prefix Enforce/avoid operation name prefix, useful if you wish to avoid prefix in your root fields, or avoid using REST terminology in your schema. 🚀
avoid-scalar-result-type-on-mutation Avoid scalar result type on mutation type to make sure to return a valid state. 🚀
avoid-typename-prefix Enforces users to avoid using the type name in a field name while defining your schema. 🚀
description-style Require all comments to follow the same style (either block or inline). 🚀
executable-definitions A GraphQL document is only valid for execution if all definitions are either operation or fragment definitions. 🔮
fields-on-correct-type 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 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. 🔮
input-name Require mutation argument to be always called "input" and input type to be called Mutation name + "Input". 🚀
known-argument-names A GraphQL field is only valid if all supplied arguments are defined by that field. 🔮
known-directives A GraphQL document is only valid if all @directives are known by the schema and legally positioned. 🔮
known-fragment-names A GraphQL document is only valid if all ...Fragment fragment spreads refer to fragments defined in the same document. 🔮
known-type-names A GraphQL document is only valid if referenced types (specifically variable definitions and fragment conditions) are defined by the type schema. 🔮
lone-anonymous-operation A GraphQL document is only valid if when it contains an anonymous operation (the query short-hand) that it contains only that one operation definition. 🔮
lone-schema-definition A GraphQL document is only valid if it contains only one schema definition. 🔮
match-document-filename This rule allows you to enforce that the file name should match the operation name. 🚀
naming-convention Require names to follow specified conventions. 🚀
no-anonymous-operations Require name for your GraphQL operations. This is useful since most GraphQL client libraries are using the operation name for caching purposes. 🚀
no-case-insensitive-enum-values-duplicates Disallow case-insensitive enum values duplicates. 🚀 🔧
no-deprecated Enforce that deprecated fields or enum values are not in use by operations. 🚀
no-fragment-cycles A GraphQL fragment is only valid when it does not have cycles in fragments usage. 🔮
no-hashtag-description Requires to use """ or " for adding a GraphQL description instead of #. 🚀
no-operation-name-suffix Makes sure you are not adding the operation type to the name of the operation. 🚀 🔧
no-undefined-variables A GraphQL operation is only valid if all variables encountered, both directly and via fragment spreads, are defined by that operation. 🔮
no-unreachable-types Requires all types to be reachable at some level by root level fields. 🚀 🔧
no-unused-fields Requires all fields to be used at some level by siblings operations. 🚀 🔧
no-unused-fragments 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 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 A GraphQL subscription is valid only if it contains a single root field. 🔮
overlapping-fields-can-be-merged 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 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. 🔮
possible-type-extension A type extension is only valid if the type is defined and has the same kind. 🔮
provided-required-arguments A field or directive is only valid if all required (non-null without a default value) field arguments have been provided. 🔮
require-deprecation-date Require deletion date on @deprecated directive. Suggest removing deprecated things after deprecated date. 🚀
require-deprecation-reason Require all deprecation directives to specify a reason. 🚀
require-description Enforce descriptions in your type definitions. 🚀
require-field-of-type-query-in-mutation-result 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-id-when-available Enforce selecting specific fields when they are available on the GraphQL type. 🚀
scalar-leafs A GraphQL document is valid only if all leaf fields (fields without sub selections) are of scalar or enum types. 🔮
selection-set-depth Limit the complexity of the GraphQL operations solely by their depth. Based on graphql-depth-limit. 🚀
strict-id-in-types 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-argument-names A GraphQL field or directive is only valid if all supplied arguments are uniquely named. 🔮
unique-directive-names A GraphQL document is only valid if all defined directives have unique names. 🔮
unique-directive-names-per-location A GraphQL document is only valid if all non-repeatable directives at a given location are uniquely named. 🔮
unique-enum-value-names A GraphQL enum type is only valid if all its values are uniquely named. 🔮
unique-field-definition-names A GraphQL complex type is only valid if all its fields are uniquely named. 🔮
unique-fragment-name Enforce unique fragment names across your project. 🚀
unique-input-field-names A GraphQL input object value is only valid if all supplied fields are uniquely named. 🔮
unique-operation-name Enforce unique operation names across your project. 🚀
unique-operation-types A GraphQL document is only valid if it has only one type per operation. 🔮
unique-type-names A GraphQL document is only valid if all defined types have unique names. 🔮
unique-variable-names A GraphQL operation is only valid if all its variables are uniquely named. 🔮
value-literals-of-correct-type A GraphQL document is only valid if all value literals are of the type expected at their position. 🔮
variables-are-input-types 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 Variables passed to field arguments conform to type. 🔮

Further Reading