Files
clientsflow/frontend/nuxt.config.ts
Ruslan Bakiev 947ef4d56d refactor: migrate CRM data layer from manual gqlFetch to Apollo Client
Replace custom gqlFetch() with proper Apollo useQuery/useMutation hooks
powered by codegen-generated TypedDocumentNode types. Key changes:

- Add GraphQL SDL schema file and codegen config for typescript-vue-apollo
- Replace all 28 raw .graphql imports with generated typed documents
- Add 12 useQuery() hooks with cache-and-network fetch policy
- Add 17 useMutation() hooks with surgical refetchQueries per mutation
- Optimistic cache update for setContactInboxHidden (instant archive UX)
- Fix contact list subtitle: show lastText instead of channel name
- Migrate login page from gqlFetch to useMutation
- WebSocket realtime now calls Apollo refetch instead of full data reload

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:07:35 +07:00

42 lines
892 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",
connectToDevTools: process.dev,
httpLinkOptions: {
credentials: "include",
},
defaultOptions: {
watchQuery: {
fetchPolicy: "cache-and-network",
},
},
},
},
},
});