mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-09 05:20:50 +00:00
962e648fe1
Replace the deprecated typescript-react-apollo codegen plugin (unmaintained for Apollo Client v4) with typed-document-node. All ~105 useXxxQuery/Mutation/Subscription call sites are rewritten to the generic useQuery/useMutation/useSubscription(XxxDocument, ...) form, with skipToken replacing skip + conditional-variables.
graphql-codegen.ts: plugins typescript-operations + typed-document-node; add scalars { Time: string } (was unknown); drop withHooks/apolloReact* options. tsconfig.app/node.json: ignoreDeprecations "6.0" for the baseUrl TS5101 deprecation. Regenerate src/graphql/types.ts.
Behavior-preserving: variables, fetchPolicy, error handling, and subscription onData/refetchQueries are unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
760 B
TypeScript
26 lines
760 B
TypeScript
import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
|
|
const config: CodegenConfig = {
|
|
documents: './graphql-schema.graphql',
|
|
generates: {
|
|
'./src/graphql/types.ts': {
|
|
config: {
|
|
dedupeFragments: true,
|
|
enumType: 'native',
|
|
exportFragmentSpreadSubTypes: true,
|
|
inlineFragmentTypes: 'combine',
|
|
scalars: { Time: 'string' },
|
|
skipTypename: true,
|
|
useTypeImports: true,
|
|
},
|
|
plugins: ['typescript-operations', 'typed-document-node'],
|
|
},
|
|
},
|
|
hooks: {
|
|
afterOneFileWrite: ['npx prettier --write'],
|
|
},
|
|
schema: '../backend/pkg/graph/schema.graphqls',
|
|
};
|
|
|
|
export default config;
|