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

Configure Feed

Select the types of activity you want to include in your feed.

fix(lsp): undefined typeArguments (#297)

authored by

Jovi De Croock and committed by
GitHub
c9eb30a0 cf539ba4

+9 -1
+5
.changeset/blue-ghosts-sell.md
··· 1 + --- 2 + '@0no-co/graphqlsp': patch 3 + --- 4 + 5 + Fix crash due to typeArguments being undefined
+4 -1
packages/graphqlsp/src/fieldUsage.ts
··· 344 344 if ('target' in type) { 345 345 const typeArguments = (type as any) 346 346 .resolvedTypeArguments as readonly ts.Type[]; 347 - dataType = typeArguments.length > 1 ? typeArguments[0] : undefined; 347 + dataType = 348 + typeArguments && typeArguments.length > 1 349 + ? typeArguments[0] 350 + : undefined; 348 351 } 349 352 // Fallback to resolving the type from scratch 350 353 if (!dataType) {