From f553c2693162d2a01b6708cd260744448adbc09b Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:40:08 +0700 Subject: [PATCH] fix: add browserHttpEndpoint for client-side Apollo requests The Apollo Client was using httpEndpoint (http://localhost:3000/api/graphql) for browser requests, which fails on remote servers. Added browserHttpEndpoint as relative URL "/api/graphql" so browser requests go to the correct origin. Also added error logging to setInboxHidden mutation. Co-Authored-By: Claude Opus 4.6 --- frontend/app/components/workspace/CrmWorkspaceApp.vue | 2 ++ frontend/nuxt.config.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/frontend/app/components/workspace/CrmWorkspaceApp.vue b/frontend/app/components/workspace/CrmWorkspaceApp.vue index 5c4dc1f..e0da94a 100644 --- a/frontend/app/components/workspace/CrmWorkspaceApp.vue +++ b/frontend/app/components/workspace/CrmWorkspaceApp.vue @@ -4367,6 +4367,8 @@ async function setInboxHidden(inboxId: string, hidden: boolean) { inboxToggleLoadingById.value = { ...inboxToggleLoadingById.value, [id]: true }; try { await doSetContactInboxHidden({ inboxId: id, hidden }); + } catch (e: unknown) { + console.error("[setInboxHidden] mutation failed:", e); } finally { inboxToggleLoadingById.value = { ...inboxToggleLoadingById.value, [id]: false }; } diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 9307eca..f0a4e6c 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -26,6 +26,7 @@ export default defineNuxtConfig({ clients: { default: { httpEndpoint: process.env.GRAPHQL_HTTP_ENDPOINT || "http://localhost:3000/api/graphql", + browserHttpEndpoint: "/api/graphql", connectToDevTools: process.dev, httpLinkOptions: { credentials: "include",