From 63bebebe11e2f5da1ae983b7256bfd1f22d7a128 Mon Sep 17 00:00:00 2001 From: Fela Maslen Date: Tue, 11 Jun 2024 12:42:39 +0100 Subject: [PATCH] chore: explained persisted call expression --- packages/graphqlsp/src/ast/checks.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/graphqlsp/src/ast/checks.ts b/packages/graphqlsp/src/ast/checks.ts index 2f4735d..a22fce2 100644 --- a/packages/graphqlsp/src/ast/checks.ts +++ b/packages/graphqlsp/src/ast/checks.ts @@ -98,6 +98,8 @@ export const getSchemaName = ( ): string | null => { if (!typeChecker) return null; const type = typeChecker.getTypeAtLocation( + // When calling `graphql.persisted`, we need to access the `graphql` part of + // the expression; `node.expression` is the `.persisted` part isTadaPersistedCall ? node.getChildAt(0).getChildAt(0) : node.expression ); if (type) {