# useGraphqlNamedOperations

Rule `biome/useGraphqlNamedOperations`. Require a name for every explicit GraphQL operation definition.

- Source: biome
- Technologies: GraphQL
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #592 by reach, #227 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/useGraphqlNamedOperations` | yes | unsafe | group correctness, since 2.0.0 | [docs](https://biomejs.dev/linter/rules/use-graphql-named-operations/) |

## Code examples

### Incorrect: the rule reports this

```graphql
query {}
```

### Correct: the rule accepts this

```graphql
query Human {
  name
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "useGraphqlNamedOperations": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/useGenericFontNames](https://lintradar.dev/rules/biome/useGenericFontNames.md): Require a generic fallback in font-family lists.
- [biome/useImageSize](https://lintradar.dev/rules/biome/useImageSize.md): Enforces that `<img>` elements have both width and height attributes.
- [biome/useDeprecatedReason](https://lintradar.dev/rules/biome/useDeprecatedReason.md): Require a reason when using the `@deprecated` directive.
- [biome/useLoneAnonymousOperation](https://lintradar.dev/rules/biome/useLoneAnonymousOperation.md): Disallow an anonymous operation in a document with other operations.
- [biome/useConvexExplicitTableIds](https://lintradar.dev/rules/biome/useConvexExplicitTableIds.md): Require the table name as the first argument of Convex database calls.
- [biome/usePackageJsonValidCpu](https://lintradar.dev/rules/biome/usePackageJsonValidCpu.md): Require the `cpu` field in `package.json` to be a valid list of processor types.

---

Web page: https://lintradar.dev/rules/biome/useGraphqlNamedOperations. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
