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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lsp-server] 馃悶 JS/TS files should only be checked when included in documents
config glob
#3588
Comments
documents
config globdocuments
config glob
re: this, this problem has been fixed in a PR last month, the stage 2 rewrite of the LSP server, after releasing the first rewrite today, I will then prepare this other branch to consolidate all of this in stage 2 rewrite. TLDR i have spent about 400 hours preparing several rewrites to address this and many more issues! you just need to make the directives available via introspection! and if not you can add them to the graphql config |
cheers for the context, and all the hard work! sounds a fix for this is already in the pipeline. 馃 if it's of any help, when available I'm happy to test the LSP rewrite for the issue reported here.
totally agree if it was just directives!
|
Is there an existing issue for this?
Current Behavior
It seems that the LSP checks and validates GraphQL code embedded in JS/TS files, even when
.graphqlrc
only lists*.graphql
globs indocuments
.This even happens when
documents
explicitly excludes JS/TS files, e.g. via!**.{js,ts}
.Expected Behavior
No checks/validations should be run on GraphQL code inside of JS/TS files when a config with
documents
glob(s) is present, which does not include those JS/TS files (or even excludes them).Steps To Reproduce
Repro: https://github.com/echocrow/gql-tada-vs-lsp-repro
.graphqlrc
config:index.ts
:In this minimal example, the LSP will unexpectedly check the GraphQL code in this TS file and flag the following:
Environment
v1.88.1
v0.9.3
Anything else?
Motivation:
There days, various tools allow us to embed GraphQL directly in JS/TS files. Sometimes, these tools also introduce new directives, or new ways of structuring fragments/queries/mutations.
However, this can leave to false-positive errors flagged by the GraphQL LSP when it validates JS/TS-embedded GraphQL code. It makes sense that it does not know about those tool-specific directives, but it is unexpected that the embedded GraphQL code is checked by the LSP at all.
The text was updated successfully, but these errors were encountered: