Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on duplicate schema #1129

Open
dontsave opened this issue Aug 8, 2022 · 2 comments
Open

error on duplicate schema #1129

dontsave opened this issue Aug 8, 2022 · 2 comments

Comments

@dontsave
Copy link

dontsave commented Aug 8, 2022

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

@dontsave dontsave changed the title breaking on duplicate schema error on duplicate schema Aug 9, 2022
@dimaMachina
Copy link
Owner

Hi, do you mean @client directives?

@dontsave
Copy link
Author

dontsave commented Aug 9, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants