Перейти до вмісту

useNamedOperation

Цей контент ще не доступний вашою мовою.

Enforce specifying the name of GraphQL operations.

This is useful because most GraphQL client libraries use the operation name for caching purposes.

query {}
code-block.graphql:1:1 lint/nursery/useNamedOperation  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Anonymous GraphQL operations are forbidden. Make sure to name your query.

> 1 │ query {}
^^^^^
2 │

Most GraphQL client libraries use the operation name for caching purposes.

Unsafe fix: Rename this query to Query.

1 │ query·Query{}
+++++
query Human {
name
}
biome.json
{
"linter": {
"rules": {
"nursery": {
"useNamedOperation": "error"
}
}
}
}