Skip to content

noDuplicateFields

No duplicated fields in GraphQL operations.

Checks for duplicate fields in selection set, variables in operation definition, or in arguments set of a field.

query test($v: String, $t: String, $v: String) {
id
}
code-block.graphql:1:36 lint/nursery/noDuplicateFields ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Variable v defined multiple times.

> 1 │ query test($v: String, $t: String, $v: String) {
^^^^^^^^^^
2 │ id
3 │ }

Remove the duplicated variable.

query {
user {
id
}
}
biome.json
{
"linter": {
"rules": {
"nursery": {
"noDuplicateFields": "error"
}
}
}
}