From 7a67bd9b646741015cf3f2478d9064537c3e8e1d Mon Sep 17 00:00:00 2001 From: Conrawl Rogers Date: Thu, 23 Nov 2023 11:37:51 -0400 Subject: [PATCH] fix: ensure clearing scanned client gql operations --- src/context.ts | 4 ++++ src/runtime/composables/index.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 2e9998d..afa76c4 100644 --- a/src/context.ts +++ b/src/context.ts @@ -85,6 +85,10 @@ async function prepareOperations (ctx: GqlContext) { return name.value }) + if (ctx.clientOps?.[client]) { + ctx.clientOps[client] = [] + } + for (const op of operations) { if (ctx.clientOps?.[client]?.includes(op)) { continue } diff --git a/src/runtime/composables/index.ts b/src/runtime/composables/index.ts index 9782552..6b78895 100644 --- a/src/runtime/composables/index.ts +++ b/src/runtime/composables/index.ts @@ -4,7 +4,7 @@ import { unref, isRef, reactive } from 'vue' import type { Ref } from 'vue' import type { AsyncData, AsyncDataOptions } from 'nuxt/dist/app/composables' import type { ClientError } from 'graphql-request' -import { KeysOf, PickFrom } from 'nuxt/dist/app/composables/asyncData' +import type { KeysOf, PickFrom } from 'nuxt/dist/app/composables/asyncData' import type { GqlState, GqlConfig, GqlError, TokenOpts, OnGqlError, GqlStateOpts } from '../../types' // @ts-ignore import { GqlSdks, GqClientOps } from '#gql'