Skip to content

The open alternative to Salesforce, designed for AI.

fix: use default Apollo client for AI chat file upload (#18158)

a827681306df196b4a03a7
diff --git a/packages/twenty-front/src/modules/ai/hooks/useAIChatFileUpload.ts b/packages/twenty-front/src/modules/ai/hooks/useAIChatFileUpload.ts
index 976e37fc6ec..0bf857eb5df 100644
--- a/packages/twenty-front/src/modules/ai/hooks/useAIChatFileUpload.ts
+++ b/packages/twenty-front/src/modules/ai/hooks/useAIChatFileUpload.ts
@@ -1,8 +1,8 @@
import { agentChatSelectedFilesStateV2 } from '@/ai/states/agentChatSelectedFilesStateV2';
import { agentChatUploadedFilesStateV2 } from '@/ai/states/agentChatUploadedFilesStateV2';
-import { useApolloCoreClient } from '@/object-metadata/hooks/useApolloCoreClient';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useRecoilStateV2 } from '@/ui/utilities/state/jotai/hooks/useRecoilStateV2';
+import { useApolloClient } from '@apollo/client';
import { useLingui } from '@lingui/react/macro';
import { type FileUIPart } from 'ai';
import { buildSignedPath, isDefined } from 'twenty-shared/utils';
@@ -13,8 +13,8 @@ import {
} from '~/generated-metadata/graphql';
export const useAIChatFileUpload = () => {
- const coreClient = useApolloCoreClient();
- const [uploadFile] = useUploadFileMutation({ client: coreClient });
+ const apolloClient = useApolloClient();
+ const [uploadFile] = useUploadFileMutation({ client: apolloClient });
const { t } = useLingui();
const { enqueueErrorSnackBar } = useSnackBar();
const [agentChatSelectedFiles, setAgentChatSelectedFiles] = useRecoilStateV2(