From d553d8021d880789563e77d969bab0c75adbaee3 Mon Sep 17 00:00:00 2001 From: Pascal Martineau Date: Wed, 24 Sep 2025 08:08:50 -0400 Subject: [PATCH] fix: defineGraphqlServerOptions --- .../themes/ccat/server/graphqlMiddleware.serverOptions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/ccat/server/graphqlMiddleware.serverOptions.ts b/wp-content/themes/ccat/server/graphqlMiddleware.serverOptions.ts index ce8bcdf..b7edbac 100644 --- a/wp-content/themes/ccat/server/graphqlMiddleware.serverOptions.ts +++ b/wp-content/themes/ccat/server/graphqlMiddleware.serverOptions.ts @@ -11,7 +11,9 @@ async function refreshAuthToken(refreshToken: string): Promise { return refreshResponse.data?.refreshJwtAuthToken?.authToken || null; } -export default defineGraphqlServerOptions({ +// The `object` generic is needed to prevent TS 2322 +// @see https://github.com/dulnan/nuxt-graphql-middleware/issues/69 +export default defineGraphqlServerOptions({ async serverFetchOptions(event) { const headers = { Cookie: getRequestHeader(event, "cookie") || "", @@ -31,8 +33,6 @@ export default defineGraphqlServerOptions({ return { headers: { ...headers, Authorization: `Bearer ${session.secure.authToken}` } }; }, - - // @ts-expect-error https://github.com/dulnan/nuxt-graphql-middleware/issues/69 async onServerResponse(event, response, _operation, operationName) { switch (operationName) { case "login":