Fix Apollo client routing for view operations in field metadata hooks (#13012)
closes https://github.com/twentyhq/twenty/issues/13010
This commit is contained in:
+3
-1
@@ -8,6 +8,7 @@ import {
|
||||
import { UPDATE_ONE_FIELD_METADATA_ITEM } from '../graphql/mutations';
|
||||
|
||||
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
||||
import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
|
||||
import { useRefreshObjectMetadataItems } from '@/object-metadata/hooks/useRefreshObjectMetadataItem';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { useFindManyRecordsQuery } from '@/object-record/hooks/useFindManyRecordsQuery';
|
||||
@@ -21,6 +22,7 @@ import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const useUpdateOneFieldMetadataItem = () => {
|
||||
const apolloClient = useApolloClient();
|
||||
const apolloCoreClient = useApolloCoreClient();
|
||||
const { refreshObjectMetadataItems } =
|
||||
useRefreshObjectMetadataItems('network-only');
|
||||
|
||||
@@ -79,7 +81,7 @@ export const useUpdateOneFieldMetadataItem = () => {
|
||||
const { data } = await apolloClient.query({ query: GET_CURRENT_USER });
|
||||
setCurrentWorkspace(data?.currentUser?.currentWorkspace);
|
||||
|
||||
const { data: viewConnection } = await apolloClient.query<{
|
||||
const { data: viewConnection } = await apolloCoreClient.query<{
|
||||
views: RecordGqlConnection;
|
||||
}>({
|
||||
query: findManyViewsQuery,
|
||||
|
||||
Reference in New Issue
Block a user