From 2bbf038d9d69376e7381347f949273326f6044ea Mon Sep 17 00:00:00 2001 From: Leonhard Rausch Date: Sun, 4 Aug 2024 17:35:56 +0200 Subject: [PATCH] fix(graphqlsp): Fix wrong fileType diagnostic error when introspection is disabled --- packages/graphqlsp/src/graphql/getSchema.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/graphqlsp/src/graphql/getSchema.ts b/packages/graphqlsp/src/graphql/getSchema.ts index ba9d89c5..4a0f1b9c 100644 --- a/packages/graphqlsp/src/graphql/getSchema.ts +++ b/packages/graphqlsp/src/graphql/getSchema.ts @@ -126,12 +126,14 @@ export const loadSchema = ( } if (ref.current) { - saveTadaIntrospection( - ref.current.introspection, - tadaOutputLocation, - tadaDisablePreprocessing, - logger - ); + if (ref.current.tadaOutputLocation !== undefined) { + saveTadaIntrospection( + ref.current.introspection, + tadaOutputLocation, + tadaDisablePreprocessing, + logger + ); + } } else if (ref.multi) { Object.values(ref.multi).forEach(value => { if (!value) return;