Skip to content

useConsistentGraphqlDescriptions (GraphQL)

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

Require all descriptions to follow the same style (either block or inline) to maintain consistency and improve readability across the schema.

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
}

This option will specify the description style.

  • "block": Requires triple-quoted block descriptions ("""...""")
  • "inline": Requires single-quoted inline descriptions ("...")

Default "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.