let codegen pick graphql endpoint from env var
This commit is contained in:
@ -1,7 +1,10 @@
|
|||||||
import { CodegenConfig } from "@graphql-codegen/cli";
|
import { CodegenConfig } from "@graphql-codegen/cli";
|
||||||
|
|
||||||
|
import { loadEnvConfig } from "@next/env";
|
||||||
|
loadEnvConfig(process.cwd());
|
||||||
|
|
||||||
const config: CodegenConfig = {
|
const config: CodegenConfig = {
|
||||||
schema: "http://127.0.0.1:8000/api/graphql/",
|
schema: process.env.GRAPHQL_ENDPOINT,
|
||||||
documents: ["src/**/*.tsx", "src/**/*.ts"],
|
documents: ["src/**/*.tsx", "src/**/*.ts"],
|
||||||
ignoreNoDocuments: true, // for better experience with the watcher
|
ignoreNoDocuments: true, // for better experience with the watcher
|
||||||
generates: {
|
generates: {
|
||||||
|
Reference in New Issue
Block a user