Mirror: TypeScript LSP plugin that finds GraphQL documents in your code and provides diagnostics, auto-complete and hover-information.

fix(graphqlsp): Fix wrong fileType diagnostic error when introspection is disabled (#348)

Co-authored-by: Leonhard Rausch <leonhard.rausch@piazzablu.com>
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>

Changed files
+13 -6
.changeset
packages
graphqlsp
src
graphql
+5
.changeset/metal-seals-swim.md
···
+
---
+
"@0no-co/graphqlsp": patch
+
---
+
+
Fix wrong fileType diagnostic error when introspection is disabled
+8 -6
packages/graphqlsp/src/graphql/getSchema.ts
···
}
if (ref.current) {
-
saveTadaIntrospection(
-
ref.current.introspection,
-
tadaOutputLocation,
-
tadaDisablePreprocessing,
-
logger
-
);
+
if (ref.current && ref.current.tadaOutputLocation !== undefined) {
+
saveTadaIntrospection(
+
ref.current.introspection,
+
tadaOutputLocation,
+
tadaDisablePreprocessing,
+
logger
+
);
+
}
} else if (ref.multi) {
Object.values(ref.multi).forEach(value => {
if (!value) return;