[lsp-server] 🐞 JS/TS files should only be checked when included in documents
config glob
#3588
Open
1 task done
Labels
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: