跳转到内容

useLoneAnonymousOperation

此内容尚不支持你的语言。

biome.json
{
"linter": {
"rules": {
"nursery": {
"useLoneAnonymousOperation": "error"
}
}
}
}

Disallow anonymous operations when more than one operation specified in document.

A GraphQL document that contains an anonymous operation (the query short-hand) is only valid if it contains only that one operation definition.

query {
fieldA
}
query B {
fieldB
}
code-block.graphql:1:1 lint/nursery/useLoneAnonymousOperation ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Document contains an anonymous operation while defining more than one operation. This anonymous operation must be the only defined operation in this document or turned into a named operation.

> 1 │ query {
^^^^^^^
> 2 │ fieldA
> 3 │ }
^
4 │
5 │ query B {

A GraphQL document that contains an anonymous operation (the query short-hand) is only valid if it contains only that one operation definition.

This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

query A {
fieldA
}
query B {
fieldB
}