graphql-eslint
graphql-eslint copied to clipboard
error on duplicate schema
Hi there. Is it possible to write a rule that would error if locally defined @client schema is a duplicate of schema from a remote endpoint? This would be very useful for projects in which client schema is written temporarily on the front-end and then implemented on the back-end later. It would be great to have the linter remind us to remove the local schema once it exists on the server
Hi, do you mean @client directives?
I guess to simplify, what I mean is if we have schema defined in two places, say:
parserOptions: {
schema:[
'schema-1.gql',
'schema-2.gql'
]
}
if schema-1 contains a type A and schema-2 also contains a type A, then we have duplicated schema. This breaks some tools like Apollo's VSCode extension. It would be great if we could be alerted of this by the linter to make sure those tools are always working. Is that possible?