diff --git a/web/codegen.ts b/web/codegen.ts index f19753d..8077e82 100644 --- a/web/codegen.ts +++ b/web/codegen.ts @@ -1,7 +1,10 @@ import { CodegenConfig } from "@graphql-codegen/cli"; +import { loadEnvConfig } from "@next/env"; +loadEnvConfig(process.cwd()); + const config: CodegenConfig = { - schema: "http://127.0.0.1:8000/api/graphql/", + schema: process.env.GRAPHQL_ENDPOINT, documents: ["src/**/*.tsx", "src/**/*.ts"], ignoreNoDocuments: true, // for better experience with the watcher generates: {