From 40f82c628a634e15209c5c9cbfde70e2581e0706 Mon Sep 17 00:00:00 2001 From: pvanliefland Date: Mon, 31 Jan 2022 18:40:50 +0100 Subject: [PATCH] AC-58 App prototype deployment Build-time GraphQL endpoint --- Dockerfile | 2 ++ src/libs/apollo.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index ea83982..f2c0090 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM node:17-alpine +ARG NEXT_PUBLIC_GRAPHQL_ENDPOINT + RUN mkdir /code WORKDIR /code diff --git a/src/libs/apollo.ts b/src/libs/apollo.ts index 097b8c2..7b69b24 100644 --- a/src/libs/apollo.ts +++ b/src/libs/apollo.ts @@ -18,6 +18,9 @@ const APOLLO_STATE_PROP_NAME = "__APOLLO_STATE__"; let apolloClient: ApolloClient | undefined; const createApolloClient = (headers: IncomingHttpHeaders | null = null) => { + console.log( + `Creating Apollo Client for "${process.env.NEXT_PUBLIC_GRAPHQL_ENDPOINT}"` + ); const enhancedFetch = (url: RequestInfo, init: RequestInit) => { return fetch(url, { ...init,