From 7aa33740c2d664ec507367d607b270968314ac6c Mon Sep 17 00:00:00 2001 From: Daniel Lehr Date: Thu, 17 Aug 2023 11:22:34 +0200 Subject: [PATCH] Fix setting `shouldCheckForColocatedFragments` to `false` falling back to `true` --- .changeset/empty-planes-behave.md | 5 +++++ packages/graphqlsp/src/diagnostics.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/empty-planes-behave.md diff --git a/.changeset/empty-planes-behave.md b/.changeset/empty-planes-behave.md new file mode 100644 index 00000000..a7b23e43 --- /dev/null +++ b/.changeset/empty-planes-behave.md @@ -0,0 +1,5 @@ +--- +'@0no-co/graphqlsp': patch +--- + +Fix setting `shouldCheckForColocatedFragments` to `false` falling back to `true` diff --git a/packages/graphqlsp/src/diagnostics.ts b/packages/graphqlsp/src/diagnostics.ts index dde3d9c0..1be2507c 100644 --- a/packages/graphqlsp/src/diagnostics.ts +++ b/packages/graphqlsp/src/diagnostics.ts @@ -48,7 +48,7 @@ export function getGraphQLDiagnostics( const tagTemplate = info.config.template || 'gql'; const scalars = info.config.scalars || {}; const shouldCheckForColocatedFragments = - info.config.shouldCheckForColocatedFragments || true; + info.config.shouldCheckForColocatedFragments ?? true; let source = getSource(info, filename); if (!source) return undefined;