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 nameDescriptionProperties
noDuplicateArgumentNamesRequire unique argument names for fields and directives.
noDuplicateEnumValueNamesDisallow duplicate names in GraphQL enums.
noDuplicateInputFieldNamesRequire fields within an input object to be unique.
noDuplicateVariableNamesRequire all variable definitions to be unique.
useGraphqlNamedOperationsRequire a name for every explicit GraphQL operation definition.
useLoneAnonymousOperationDisallow an anonymous operation in a document with other operations.
Rule nameDescriptionProperties
noDuplicateFieldDefinitionNamesRequire all fields of a type to be unique.
Rule nameDescriptionProperties
noExcessiveLinesPerFileRestrict the number of lines in a file.
noRootTypeDisallow configured GraphQL root operation types.
useConsistentGraphqlDescriptionsRequire one description style throughout a GraphQL schema.
useDeprecatedReasonRequire a reason when using the @deprecated directive.
useGraphqlNamingConventionRequire uppercase names for GraphQL enum values.
useInputNameRequire mutation arguments to be named input.
useLoneExecutableDefinitionRequire one executable GraphQL definition per file.
Rule nameDescriptionProperties
noDuplicateFieldsDisallow duplicate names inside GraphQL operations.
noDuplicateGraphqlOperationNameRequire unique operation names within a GraphQL document.
noEmptySourceDisallow empty sources.
useDeprecatedDateRequire a valid deletion date on the @deprecated directive.

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