src/content/docs/linter/rules/no-duplicate-field-definition-names.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="GraphQL" icon="seti:graphql"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.3.11` - Diagnostic Category: [`lint/nursery/noDuplicateFieldDefinitionNames`](/reference/diagnostics#diagnostic-category) - This rule doesn't have a fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - Sources: - Same as [`@graphql-eslint/unique-field-definition-names`](https://the-guild.dev/graphql/eslint/rules/unique-field-definition-names){
"linter": {
"rules": {
"nursery": {
"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
}
interface SomeObject {
foo: String
foo: String
}
input SomeObject {
foo: String
foo: String
}
type SomeObject {
foo: String
bar: String
}
interface SomeObject {
foo: String
bar: String
}
input SomeObject {
foo: String
bar: String
}