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:
nitin
2025-07-03 02:40:26 +05:30
committed by GitHub
parent 41becaaea4
commit 3801785d02
2 changed files with 7 additions and 4 deletions
@@ -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,