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":