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

Add support for unrolling default exports (#372)

Changed files
+9
.changeset
packages
graphqlsp
src
+5
.changeset/many-garlics-visit.md
···
+
---
+
'@0no-co/graphqlsp': patch
+
---
+
+
Fix support for default exported graphql() invocations
+4
packages/graphqlsp/src/ast/declaration.ts
···
| ts.ConstructorDeclaration
| ts.EnumDeclaration
| ts.EnumMember
+
| ts.ExportAssignment
| ts.ExportSpecifier
| ts.FunctionDeclaration
| ts.FunctionExpression
···
case ts.SyntaxKind.Constructor:
case ts.SyntaxKind.EnumDeclaration:
case ts.SyntaxKind.EnumMember:
+
case ts.SyntaxKind.ExportAssignment:
case ts.SyntaxKind.FunctionDeclaration:
case ts.SyntaxKind.FunctionExpression:
case ts.SyntaxKind.GetAccessor:
···
case ts.SyntaxKind.PropertyDeclaration:
case ts.SyntaxKind.VariableDeclaration:
return node.initializer;
+
case ts.SyntaxKind.ExportAssignment:
+
return node.expression;
case ts.SyntaxKind.BinaryExpression:
return isAssignmentOperator(node.operatorToken) ? node.right : undefined;
case ts.SyntaxKind.ShorthandPropertyAssignment: