You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When I duplicate fields in my schema and use codegen, I get errors like these:
Looks like this error is coming in from graphql-js and not codegen itself. But I don't find a rule for duplicated fields (in schema) as a rule. There is a rule for documents though.
Describe the solution you'd like
Adding a new rule for duplicated fields in schema in graphql-eslint can address this.
Describe alternatives you've considered
Alternative currently is to rely on codegen for throwing errors like these, but this can be captured in eslint itself.
The text was updated successfully, but these errors were encountered:
Hi @tvvignesh, currently buildSchema from graphql throws an error when find a duplicated field for ObjectTypeDefinition, InterfaceTypeDefinition, EnumTypeDefinition, InputObjectTypeDefinition kinds and same for their extensions ObjectTypeExtension... etc.
I agree with you, we can validate duplication fields before building our schema, the new rule or new option for the existing rule avoid-duplicate-fields will be added 😉
UPDATE:
We have already rules from graphql-js that checks for duplication fields, like unique-field-definition-names, unique-input-field-names, unique-enum-value-names and they work not as expected, when you have split schema for multiple files, I'll try to fix this
Is your feature request related to a problem? Please describe.
When I duplicate fields in my schema and use codegen, I get errors like these:
Looks like this error is coming in from
graphql-js
and not codegen itself. But I don't find a rule for duplicated fields (in schema) as a rule. There is a rule for documents though.Describe the solution you'd like
Adding a new rule for duplicated fields in schema in
graphql-eslint
can address this.Describe alternatives you've considered
Alternative currently is to rely on codegen for throwing errors like these, but this can be captured in eslint itself.
The text was updated successfully, but these errors were encountered: