Skip to content

GraphQL Rules

Below the list of rules supported by Biome, divided by group. Here’s a legend of the emojis:

  • The icon indicates that the rule is part of the recommended rules.
  • The icon indicates that the rule provides a code action (fix) that is safe to apply.
  • The icon indicates that the rule provides a code action (fix) that is unsafe to apply.
  • The icon indicates that the rule has been implemented and scheduled for the next release.
Rule name Description Properties
noDuplicateArgumentNames Require unique argument names for fields and directives.
noDuplicateEnumValueNames Disallow duplicate names in GraphQL enums.
noDuplicateFieldDefinitionNames Require all fields of a type to be unique.
noDuplicateInputFieldNames Require fields within an input object to be unique.
noDuplicateVariableNames Require all variable definitions to be unique.
useGraphqlNamedOperations Require a name for every explicit GraphQL operation definition.
useLoneAnonymousOperation Disallow an anonymous operation in a document with other operations.
Rule name Description Properties
useConsistentUnicodeBom Require or disallow a Unicode byte order mark at the beginning of a file.
Rule name Description Properties
noExcessiveLinesPerFile Restrict the number of lines in a file.
noRootType Disallow configured GraphQL root operation types.
useConsistentGraphqlDescriptions Require one description style throughout a GraphQL schema.
useDeprecatedReason Require a reason when using the @deprecated directive.
useGraphqlNamingConvention Require uppercase names for GraphQL enum values.
useInputName Require mutation arguments to be named input.
useLoneExecutableDefinition Require one executable GraphQL definition per file.
Rule name Description Properties
noDuplicateFields Disallow duplicate names inside GraphQL operations.
noDuplicateGraphqlOperationName Require unique operation names within a GraphQL document.
noEmptySource Disallow empty sources.
useDeprecatedDate Require a valid deletion date on the @deprecated directive.

Missing a rule? Help us by contributing to the analyzer or create a rule suggestion here.