useLoneAnonymousOperation
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since:
v2.3.12 - Diagnostic Category:
lint/nursery/useLoneAnonymousOperation - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useLoneAnonymousOperation": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.