-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Why "no-unused-variables" and "no-unused-fragments" rules requires GraphQL Schema and Operations? #1172
Comments
🆙 |
🆙 (bis) |
A fragment could be used in another |
Hi @FloEdelmann and thanks for your reply. Ok I understand for |
we need to see overall siblings whether it's used or not somewhere
same as above because fragments can contain variables |
Ok, so what about a rule dedicated to check unused variables/fragment in a single |
what do you want to omit schema or siblings? also, I guess requires |
I'm in a use case where the schema is very difficult to fetch from the editor while working on the webapp because of complexe authentication process. In addition the schema is updated relatively often so downloading it as a file is not really an option. So my goal is to enforce the maximum number of rules without the schema. We don't use fragment so often (despite we should probably), however we already discover unused variables in some of our |
Hi @B2o5T , hope you are well :) |
For additional context, my use case does have access to the operations (via |
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
I don't understand why
no-unused-variables
andno-unused-fragments
rules requires GraphQL Schema and Operations?To Reproduce
Steps to reproduce the behavior:
Simpy use that rules without providing GraphQL Schema or Operations.
Expected behavior
Abilty to use
no-unused-variables
andno-unused-fragments
rules without defined GraphQL Schema and Operations.Environment:
@graphql-eslint/eslint-plugin
: N/AAdditional context
I'm working on a frontend webapp where the API schema is not easily reachable because of complexe authentication process. In addition, the API is under active development and the schema is often updated so I can't just download the schema one time and forget.
Still, I would like to ensure that no one left unused variables and/or fragments in
.gql
files. I don't understand why this plugin need to know the GraphQL Schema and Operations to check for unused variables and/or fragments in a single.gql
file. Could you please explain?The text was updated successfully, but these errors were encountered: