codegen.ts

 1import type { CodegenConfig } from "@graphql-codegen/cli";
 2
 3const config: CodegenConfig = {
 4  schema: "../api/graphql/schema/*.graphql",
 5  documents: "src/graphql/**/*.graphql",
 6  generates: {
 7    "src/__generated__/graphql.ts": {
 8      plugins: ["typescript", "typescript-operations", "typescript-react-apollo"],
 9      config: {
10        withHooks: true,
11        withComponent: false,
12        withHOC: false,
13        apolloReactHooksImportFrom: "@apollo/client/react",
14        scalars: {
15          Time: "string",
16          Hash: "string",
17          CombinedId: "string",
18          Color: "{ R: number; G: number; B: number }",
19        },
20      },
21    },
22  },
23};
24
25export default config;