noDuplicateVariableNames
Summary
Section titled “Summary”- Rule available since:
v2.3.11 - Diagnostic Category:
lint/correctness/noDuplicateVariableNames - This rule is recommended, meaning it is enabled by default.
- This rule doesn’t have a fix.
- The default severity of this rule is error.
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "correctness": { "noDuplicateVariableNames": "error" } } }}Description
Section titled “Description”Require all variable definitions to be unique.
A GraphQL operation is only valid if all its variables are uniquely named.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”query ($x: Int, $x: Int) { field}code-block.graphql:1:7 lint/correctness/noDuplicateVariableNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate variable name.
> 1 │ query ($x: Int, $x: Int) {
│ ^^^^^^^^^^^^^^^^^^
2 │ field
3 │ }
ℹ A GraphQL operation is only valid if all its variables are uniquely named. Make sure to name every variable differently.
query ($x: Int, $y: Int) { field}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.