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

fix(tada): stop overriding the fragments array (#233)

Changed files
+6 -1
.changeset
packages
graphqlsp
src
ast
+5
.changeset/thick-monkeys-tan.md
···
+
---
+
'@0no-co/graphqlsp': patch
+
---
+
+
Fix issue where a missing argument 2 for a call-expression would make us erase prior found fragment-definitions
+1 -1
packages/graphqlsp/src/ast/index.ts
···
if (!hasTriedToFindFragments && !arg2) {
hasTriedToFindFragments = true;
-
fragments = getAllFragments(sourceFile.fileName, node, info);
+
fragments.push(...getAllFragments(sourceFile.fileName, node, info));
} else if (arg2 && ts.isArrayLiteralExpression(arg2)) {
arg2.elements.forEach(element => {
if (ts.isIdentifier(element)) {