Skip to content

useConsistentGraphqlDescriptions (GraphQL)

Language GraphQL
biome.json
{
"linter": {
"rules": {
"style": {
"useConsistentGraphqlDescriptions": "error"
}
}
}
}

Require one description style throughout a GraphQL schema.

GraphQL supports triple-quoted block descriptions and one-line descriptions in double quotes. Using one style consistently makes schema documentation easier to scan.

enum EnumValue {
"this is a description"
DEFAULT
}
code-block.graphql:2:3 lint/style/useConsistentGraphqlDescriptions ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Unexpected inline description style.

1 │ enum EnumValue {
> 2 │ "this is a description"
│ ^^^^^^^^^^^^^^^^^^^^^^^
3 │ DEFAULT
4 │ }

ℹ To stay consistent within the project, write the description block style.

enum EnumValue {
"""
this is a description
"""
DEFAULT
}

Selects the required description style:

  • "block" requires triple-quoted descriptions ("""...""");
  • "inline" requires one-line descriptions in double quotes ("...").

Defaults to "block".

biome.json
{
"linter": {
"rules": {
"style": {
"useConsistentGraphqlDescriptions": {
"level": "on",
"options": {
"style": "inline"
}
}
}
}
}
}
enum EnumValue {
"""
this is a description
"""
DEFAULT
}
code-block.graphql:2:3 lint/style/useConsistentGraphqlDescriptions ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ Unexpected block description style.

1 │ enum EnumValue {
> 2 │ """
│ ^^^
> 3 │ this is a description
> 4 │ """
│ ^^^
5 │ DEFAULT
6 │ }

ℹ To stay consistent within the project, write the description inline style.