useUniqueFieldDefinitionNames
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/useUniqueFieldDefinitionNames - 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": { "useUniqueFieldDefinitionNames": "error" } } }}Description
Section titled “Description”Require all fields of a type to be unique.
A GraphQL complex type is only valid if all its fields are uniquely named.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”type SomeObject { foo: String foo: String}code-block.graphql:1:1 lint/nursery/useUniqueFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Duplicate field name.
> 1 │ type SomeObject {
│ ^^^^^^^^^^^^^^^^^
> 2 │ foo: String
> 3 │ foo: String
> 4 │ }
│ ^
5 │
ℹ A GraphQL complex type is only valid if all its fields are uniquely named. Make sure to name every field differently.
ℹ 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.
interface SomeObject { foo: String foo: String}code-block.graphql:1:1 lint/nursery/useUniqueFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Duplicate field name.
> 1 │ interface SomeObject {
│ ^^^^^^^^^^^^^^^^^^^^^^
> 2 │ foo: String
> 3 │ foo: String
> 4 │ }
│ ^
5 │
ℹ A GraphQL complex type is only valid if all its fields are uniquely named. Make sure to name every field differently.
ℹ 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.
input SomeObject { foo: String foo: String}code-block.graphql:1:1 lint/nursery/useUniqueFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Duplicate field name.
> 1 │ input SomeObject {
│ ^^^^^^^^^^^^^^^^^^
> 2 │ foo: String
> 3 │ foo: String
> 4 │ }
│ ^
5 │
ℹ A GraphQL complex type is only valid if all its fields are uniquely named. Make sure to name every field differently.
ℹ 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.
type SomeObject { foo: String bar: String}interface SomeObject { foo: String bar: String}input SomeObject { foo: String bar: String}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.