-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Field(s) ... are not used.
on fields that are used.
#10122
Comments
Inconvenient solution: if I create the query elsewhere and import it the issue disappears. |
I managed to find out more about it, and it's likely a separate problem, filed here: #10127 |
Hi, could you please let me know which tool or language server is showing this error? |
@eddeee888 it comes from |
If it's from |
Well, it depends. In the case of the issue I branched off this one, there's no issue on that project as it's designed. It works together with a suite of tools that competes with codegen. But the way this (codegen) project requires code be written is incompatible with how the LSP works. Unless the LSP explicitly adds support for codegen, which I suspect would take some level of official coordination at a minimum, there's no bug over there. |
Would it be possible to get a minimal reproducible repo? It'll help speed up the debugging process 🙂 AFAIK, the LSP in question works at a different level to Codegen: LSP does code analysis on TypeScript sources to report unused field errors, whereas Codegen generates types from GraphQL sources. You can see the error message being reported by the LSP here. There are similar issues related to this error message here: https://github.com/0no-co/GraphQLSP/issues?q=is%3Aissue+%22unused%22 I would highly recommend opening an issue in https://github.com/0no-co/GraphQLSP, unless there's a reproducible repo to help confirm the issue. |
Which packages are impacted by your issue?
@graphql-codegen/core
Describe the bug
I want to preface this by saying that I won't provide a repro URL, I don't have the time to so, feel free to close it.
However I crated this mockup code in order to illustrate what the issue is:
When I have a query inside of a function where some of the fields are used but the rest are simply returned, I get tons of
Field(s) ... are not used.
warnings for the fields that are returned to use externally but are not used internally.It happens for all the fields that I don't access inside the function.
I can't tsignore anything inside
graphql(...)
so I have no idea how to fix it.Codegen Config File
The text was updated successfully, but these errors were encountered: