import { CodegenConfig } from "@graphql-codegen/cli"; import { loadEnvConfig } from "@next/env"; loadEnvConfig(process.cwd()); const config: CodegenConfig = { schema: process.env.GRAPHQL_ENDPOINT, documents: ["src/**/*.tsx", "src/**/*.ts"], ignoreNoDocuments: true, // for better experience with the watcher generates: { "./src/gql/": { preset: "client", presetConfig: { fragmentMasking: { unmaskFunctionName: "unmaskFragment" }, }, config: { scalars: { DateTime: "string", JSONString: "string", PositiveInt: "number", RichText: "string", UUID: "string", }, }, }, }, }; export default config;