Skip to content

Commit

Permalink
fix(graphqlsp): Fix wrong fileType diagnostic error when introspectio…
Browse files Browse the repository at this point in the history
…n is disabled (#348)

Co-authored-by: Leonhard Rausch <leonhard.rausch@piazzablu.com>
Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent b426515 commit d0b4301
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/metal-seals-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@0no-co/graphqlsp": patch
---

Fix wrong fileType diagnostic error when introspection is disabled
14 changes: 8 additions & 6 deletions packages/graphqlsp/src/graphql/getSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,14 @@ export const loadSchema = (
}

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;
Expand Down

0 comments on commit d0b4301

Please sign in to comment.