let codegen pick graphql endpoint from env var

This commit is contained in:
2024-06-24 00:59:57 +02:00
parent 2925ef68b0
commit 33be02ee69

View File

@ -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: {