From 15647774edb2575e93f17db8334f1c9114b0f3e8 Mon Sep 17 00:00:00 2001 From: "deep-foundation-sweepai[bot]" <144620334+deep-foundation-sweepai[bot]@users.noreply.github.com> Date: Tue, 12 Sep 2023 12:01:09 +0000 Subject: [PATCH] Updated client.tsx --- client.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/client.tsx b/client.tsx index 4639a04..604c9af 100644 --- a/client.tsx +++ b/client.tsx @@ -1,4 +1,10 @@ -import { HttpLink, InMemoryCache, ApolloClient } from '@apollo/client'; +import { HttpLink, InMemoryCache, ApolloClient as BaseApolloClient } from '@apollo/client'; + +export type ApolloClient = BaseApolloClient & { + path: string; + ssl: boolean; + jwt_token: string; +}; import { getMainDefinition } from '@apollo/client/utilities'; import { ApolloLink, concat, split } from 'apollo-link'; import { WebSocketLink } from 'apollo-link-ws'; @@ -37,7 +43,7 @@ export function generateHeaders(options: IApolloClientGeneratorOptions) { return headers; } -export interface IApolloClient extends ApolloClient { +export interface IApolloClient extends ApolloClient { jwt_token?: string; path?: string; ssl?: boolean; @@ -51,7 +57,7 @@ export function generateApolloClient( ApolloClient?: any; InMemoryCache?: any; }, -): ApolloClient { +): ApolloClient { debug('generateApolloClient', options, forwardingArguments); const isRelative = typeof(options?.relative) === 'boolean' ? options.relative : typeof(ENV_RELATIVE) === 'boolean' ? ENV_RELATIVE : false; @@ -100,7 +106,7 @@ export function generateApolloClient( httpLink, ); - const client: IApolloClient = new ApolloClient({ + const client: IApolloClient = new BaseApolloClient({ ssrMode: true, // @ts-ignore link: concat(authMiddleware, link),