Skip to content

Commit

Permalink
Remove unnecessary explicit suspenseCache from apollo provider
Browse files Browse the repository at this point in the history
  • Loading branch information
hbriese committed Jul 14, 2023
1 parent f67189a commit 86a77a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/src/gql/GqlProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, ReactNode, useContext, useState } from 'react';
import { ApolloClient, ApolloProvider, NormalizedCacheObject, SuspenseCache } from '@apollo/client';
import { ApolloClient, ApolloProvider, NormalizedCacheObject } from '@apollo/client';
import { Suspend } from '~/components/Suspender';
import useAsyncEffect from 'use-async-effect';
import { API_CLIENT_NAME, usePromisedApiClient } from '@api/client';
Expand All @@ -19,8 +19,6 @@ const useGqlClients = () => useContext(context)!;
export const useApiClient = () => useGqlClients().api;
export const useUniswapClient = () => useGqlClients().uniswap;

const suspenseCache = new SuspenseCache();

export interface GqlProviderProps {
children: ReactNode;
}
Expand Down Expand Up @@ -56,7 +54,7 @@ export const GqlProvider = ({ children }: GqlProviderProps) => {
if (!isGqlClients(clients)) return <Suspend />;

return (
<ApolloProvider client={clients.api} suspenseCache={suspenseCache}>
<ApolloProvider client={clients.api}>
<context.Provider value={clients}>{children}</context.Provider>
</ApolloProvider>
);
Expand Down

0 comments on commit 86a77a6

Please sign in to comment.