feat: use ApolloFactory for metadata client (#4608)
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -11,9 +11,9 @@ import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
|
||||
import { useUpdateEffect } from '~/hooks/useUpdateEffect';
|
||||
import { isDefined } from '~/utils/isDefined';
|
||||
|
||||
import { ApolloFactory } from '../services/apollo.factory';
|
||||
import { ApolloFactory, Options } from '../services/apollo.factory';
|
||||
|
||||
export const useApolloFactory = () => {
|
||||
export const useApolloFactory = (options: Partial<Options<any>> = {}) => {
|
||||
// eslint-disable-next-line @nx/workspace-no-state-useref
|
||||
const apolloRef = useRef<ApolloFactory<NormalizedCacheObject> | null>(null);
|
||||
const [isDebugMode] = useRecoilState(isDebugModeState);
|
||||
@ -50,6 +50,8 @@ export const useApolloFactory = () => {
|
||||
},
|
||||
extraLinks: [],
|
||||
isDebugMode,
|
||||
// Override options
|
||||
...options,
|
||||
});
|
||||
|
||||
return apolloRef.current.getClient();
|
||||
|
||||
Reference in New Issue
Block a user