Skip to content

Commit

Permalink
AC-58 App prototype deployment
Browse files Browse the repository at this point in the history
Build-time GraphQL endpoint
  • Loading branch information
pvanliefland committed Jan 31, 2022
1 parent 1eea752 commit 40f82c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM node:17-alpine

ARG NEXT_PUBLIC_GRAPHQL_ENDPOINT

RUN mkdir /code
WORKDIR /code

Expand Down
3 changes: 3 additions & 0 deletions src/libs/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const APOLLO_STATE_PROP_NAME = "__APOLLO_STATE__";
let apolloClient: ApolloClient<NormalizedCacheObject> | 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,
Expand Down

0 comments on commit 40f82c6

Please sign in to comment.