From c2e85550f92bef6a2a8353c715dce32f445823b0 Mon Sep 17 00:00:00 2001 From: Ole-Martin Bratteng <1681525+omBratteng@users.noreply.github.com> Date: Thu, 23 Jan 2025 07:37:37 +0100 Subject: [PATCH] tmp: disable content-language for gql tmp: dirty hack to not send content-language in feed --- packages/shared/src/graphql/common.ts | 5 +++++ packages/shared/src/hooks/useFeed.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/shared/src/graphql/common.ts b/packages/shared/src/graphql/common.ts index fd9b0a4ba8..66d7c6411b 100644 --- a/packages/shared/src/graphql/common.ts +++ b/packages/shared/src/graphql/common.ts @@ -149,5 +149,10 @@ export const gqlClient = new GraphQLClient(graphqlUrl, { fetch: globalThis.fetch, }); +export const gqlClient2 = new GraphQLClient(graphqlUrl, { + credentials: 'include', + fetch: globalThis.fetch, +}); + export const gqlRequest: typeof gqlClient.request = (...args) => gqlClient.request(...args); diff --git a/packages/shared/src/hooks/useFeed.ts b/packages/shared/src/hooks/useFeed.ts index 626526bc58..912aa06829 100644 --- a/packages/shared/src/hooks/useFeed.ts +++ b/packages/shared/src/hooks/useFeed.ts @@ -16,7 +16,7 @@ import { } from '../lib/query'; import type { MarketingCta } from '../components/marketingCta/common'; import { FeedItemType } from '../components/cards/common/common'; -import { GARMR_ERROR, gqlClient } from '../graphql/common'; +import { GARMR_ERROR, gqlClient2 } from '../graphql/common'; import { usePlusSubscription } from './usePlusSubscription'; import { fetchAd } from '../lib/ads'; import { LogEvent } from '../lib/log'; @@ -110,7 +110,7 @@ export default function useFeed( const feedQuery = useInfiniteQuery({ queryKey: feedQueryKey, queryFn: async ({ pageParam }) => { - const res = await gqlClient.request(query, { + const res = await gqlClient2.request(query, { ...variables, first: pageSize, after: pageParam,