| import type { CodegenConfig } from "@graphql-codegen/cli"; | |
| import { loadEnvConfig } from "@next/env"; | |
| const projectDir = process.cwd(); | |
| loadEnvConfig(projectDir); | |
| const config: CodegenConfig = { | |
| overwrite: true, | |
| schema: { | |
| [`${process.env.NEXT_PUBLIC_WORDPRESS_API_URL}/graphql`]: { | |
| headers: { | |
| "User-Agent": "Codegen", | |
| }, | |
| }, | |
| }, | |
| generates: { | |
| "src/gql/": { | |
| preset: "client", | |
| }, | |
| "src/gql/schema.gql": { | |
| plugins: ["schema-ast"], | |
| }, | |
| }, | |
| }; | |
| export default config; | |