Skip to content

Commit

Permalink
Updated client.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
deep-foundation-sweepai[bot] authored Sep 12, 2023
1 parent 202846e commit 1564777
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions client.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { HttpLink, InMemoryCache, ApolloClient } from '@apollo/client';
import { HttpLink, InMemoryCache, ApolloClient as BaseApolloClient } from '@apollo/client';

export type ApolloClient = BaseApolloClient<any> & {
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';
Expand Down Expand Up @@ -37,7 +43,7 @@ export function generateHeaders(options: IApolloClientGeneratorOptions) {
return headers;
}

export interface IApolloClient<T> extends ApolloClient<T> {
export interface IApolloClient<T> extends ApolloClient {

Check failure on line 46 in client.tsx

View workflow job for this annotation

GitHub Actions / main / test

Interface 'IApolloClient<T>' incorrectly extends interface 'ApolloClient<any> & { path: string; ssl: boolean; jwt_token: string; }'.
jwt_token?: string;
path?: string;
ssl?: boolean;
Expand All @@ -51,7 +57,7 @@ export function generateApolloClient(
ApolloClient?: any;
InMemoryCache?: any;
},
): ApolloClient<any> {
): ApolloClient {
debug('generateApolloClient', options, forwardingArguments);

const isRelative = typeof(options?.relative) === 'boolean' ? options.relative : typeof(ENV_RELATIVE) === 'boolean' ? ENV_RELATIVE : false;
Expand Down Expand Up @@ -100,7 +106,7 @@ export function generateApolloClient(
httpLink,
);

const client: IApolloClient<any> = new ApolloClient({
const client: IApolloClient<any> = new BaseApolloClient({
ssrMode: true,
// @ts-ignore
link: concat(authMiddleware, link),
Expand Down

0 comments on commit 1564777

Please sign in to comment.