Skip to content

noDuplicateFieldDefinitionNames (GraphQL)

Language GraphQL
biome.json
{
"linter": {
"rules": {
"correctness": {
"noDuplicateFieldDefinitionNames": "error"
}
}
}
}

Require all fields of a type to be unique.

A GraphQL complex type is only valid if all its fields are uniquely named.

type SomeObject {
foo: String
foo: String
}
code-block.graphql:2:3 lint/correctness/noDuplicateFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The field name "foo" is used more than once.

1 │ type SomeObject {
> 2 │ foo: String
│ ^^^
3 │ foo: String
4 │ }

ℹ The field "foo" is repeated here.

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.

interface SomeObject {
foo: String
foo: String
}
code-block.graphql:2:3 lint/correctness/noDuplicateFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The field name "foo" is used more than once.

1 │ interface SomeObject {
> 2 │ foo: String
│ ^^^
3 │ foo: String
4 │ }

ℹ The field "foo" is repeated here.

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.

input SomeObject {
foo: String
foo: String
}
code-block.graphql:2:3 lint/correctness/noDuplicateFieldDefinitionNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The field name "foo" is used more than once.

1 │ input SomeObject {
> 2 │ foo: String
│ ^^^
3 │ foo: String
4 │ }

ℹ The field "foo" is repeated here.

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.

type SomeObject {
foo: String
bar: String
}
interface SomeObject {
foo: String
bar: String
}
input SomeObject {
foo: String
bar: String
}