noDuplicateInputFieldNames
Summary
Section titled “Summary”- Rule available since:
v2.3.11 - Diagnostic Category:
lint/correctness/noDuplicateInputFieldNames - 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": { "noDuplicateInputFieldNames": "error" } } }}Description
Section titled “Description”Require fields within an input object to be unique.
A GraphQL input object value is only valid if all supplied fields are uniquely named.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”query { field(arg: { f1: "value", f1: "value" })}code-block.graphql:2:14 lint/correctness/noDuplicateInputFieldNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Duplicate input field name.
1 │ query {
> 2 │ field(arg: { f1: “value”, f1: “value” })
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 │ }
4 │
ℹ A GraphQL input object value is only valid if all supplied fields are uniquely named. Make sure to name every input field differently.
query { field(arg: { f1: "value", f2: "value" })}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.