Skip to content

noDuplicateGraphqlOperationName (GraphQL)

Language GraphQL
biome.json
{
"linter": {
"rules": {
"suspicious": {
"noDuplicateGraphqlOperationName": "error"
}
}
}
}

Require unique operation names within a GraphQL document.

Distinct names let clients, logs, and debugging tools identify each query, mutation, or subscription without ambiguity.

query user {
user {
id
}
}
query user {
me {
id
}
}
code-block.graphql:1:7 lint/suspicious/noDuplicateGraphqlOperationName ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

⚠ The operation name "user" is used more than once.

> 1 │ query user {
│ ^^^^
2 │ user {
3 │ id

ℹ The operation "user" is repeated here.

5 │ }
6 │
> 7 │ query user {
│ ^^^^
8 │ me {
9 │ id

ℹ GraphQL operation names must be unique to ensure proper identification.

ℹ Rename the operation to have a unique name.

query user {
user {
id
}
}
query me {
me {
id
}
}