From 8bda18584874810cafa62fcd26256999aa2914b5 Mon Sep 17 00:00:00 2001 From: Lucid Date: Sat, 6 Dec 2025 21:36:45 -0500 Subject: [PATCH] fix env variable --- src/app/api/graphql/route.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/api/graphql/route.ts b/src/app/api/graphql/route.ts index 72f0c43..c6afd97 100644 --- a/src/app/api/graphql/route.ts +++ b/src/app/api/graphql/route.ts @@ -11,8 +11,7 @@ interface NextContext { const environment = process.env.NODE_ENV || "development"; const isValidApiKey = (apiKey: string): boolean => { - console.log(process.env); - const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN; + const envApiKey = process.env.NEXT_PUBLIC_API_TOKEN || process.env.API_TOKEN; return apiKey === envApiKey; }; @@ -59,7 +58,10 @@ const { handleRequest } = createYoga({ }), // While using Next.js file convention for routing, we need to configure Yoga to use the correct endpoint - graphqlEndpoint: process.env.NEXT_PUBLIC_GRAPHQL_URL || "/api/graphql", + graphqlEndpoint: + process.env.NEXT_PUBLIC_GRAPHQL_URL || + process.env.GRAPHQL_UR || + "/api/graphql", // Yoga needs to know how to create a valid Next response fetchAPI: { Response },