Files
pentagi/frontend/graphql-codegen.ts
T
Sergey KozyrenkoandClaude Opus 4.7 8a3d4e951d chore(frontend): upgrade graphql-codegen toolchain
Bumps the codegen stack: cli 6→7, client-preset 5→6, typescript 5→6,
typescript-operations 5→6 (typescript-react-apollo and
near-operation-file-preset only moved within their minor range).

Configures typescript-react-apollo to emit Apollo v4-compatible imports
via apolloReactCommonImportFrom / apolloReactHooksImportFrom set to
@apollo/client/react, so re-running pnpm run graphql:generate now
produces ApolloReactCommon / ApolloReactHooks namespaces from the v4
subpath instead of the v3 single-entry import.

src/graphql/types.ts is fully regenerated under the new config.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 09:39:20 +07:00

28 lines
906 B
TypeScript

import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
documents: './graphql-schema.graphql',
generates: {
'./src/graphql/types.ts': {
config: {
dedupeFragments: true,
exportFragmentSpreadSubTypes: true,
apolloReactCommonImportFrom: '@apollo/client/react',
apolloReactHooksImportFrom: '@apollo/client/react',
inlineFragmentTypes: 'combine',
preResolveTypes: true,
skipTypename: true,
useTypeImports: true,
withHooks: true,
},
plugins: ['typescript', 'typescript-operations', 'typescript-react-apollo'],
},
},
hooks: {
afterOneFileWrite: ['npx prettier --write'],
},
schema: '../backend/pkg/graph/schema.graphqls',
};
export default config;