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 <noreply@anthropic.com>
43 lines
937 B
TypeScript
43 lines
937 B
TypeScript
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: "2025-07-15",
|
|
devtools: { enabled: true },
|
|
css: ["~/assets/css/main.css"],
|
|
nitro: {
|
|
experimental: {
|
|
websocket: true,
|
|
},
|
|
},
|
|
|
|
vite: {
|
|
plugins: [tailwindcss() as any],
|
|
},
|
|
|
|
modules: ["@nuxt/eslint", "@nuxtjs/apollo"],
|
|
|
|
runtimeConfig: {
|
|
public: {
|
|
graphqlHttpEndpoint: process.env.GRAPHQL_HTTP_ENDPOINT || "http://localhost:3000/api/graphql",
|
|
},
|
|
},
|
|
|
|
apollo: {
|
|
clients: {
|
|
default: {
|
|
httpEndpoint: process.env.GRAPHQL_HTTP_ENDPOINT || "http://localhost:3000/api/graphql",
|
|
browserHttpEndpoint: "/api/graphql",
|
|
connectToDevTools: process.dev,
|
|
httpLinkOptions: {
|
|
credentials: "include",
|
|
},
|
|
defaultOptions: {
|
|
watchQuery: {
|
|
fetchPolicy: "cache-and-network",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|