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>
26 lines
608 B
TypeScript
26 lines
608 B
TypeScript
import type { CodegenConfig } from "@graphql-codegen/cli";
|
|
|
|
const config: CodegenConfig = {
|
|
schema: "graphql/schema.graphql",
|
|
documents: ["graphql/operations/**/*.graphql"],
|
|
generates: {
|
|
"graphql/generated.ts": {
|
|
plugins: [
|
|
"typescript",
|
|
"typescript-operations",
|
|
"typescript-vue-apollo",
|
|
],
|
|
config: {
|
|
withCompositionFunctions: true,
|
|
vueCompositionApiImportFrom: "vue",
|
|
dedupeFragments: true,
|
|
namingConvention: "keep",
|
|
useTypeImports: true,
|
|
},
|
|
},
|
|
},
|
|
ignoreNoDocuments: false,
|
|
};
|
|
|
|
export default config;
|