Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 94dc70f

Browse files
committed
use getEnvVar()
1 parent 5c61c78 commit 94dc70f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

api/wordpress/connector.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import {useMemo} from 'react'
22
import {ApolloClient, HttpLink, InMemoryCache} from '@apollo/client'
33
import merge from 'deepmerge'
44
import isEqual from 'lodash/isEqual'
5+
import {getEnvVar} from '@/lib/functions'
6+
7+
// Define env vars.
8+
export const wpApiUrlBase = getEnvVar('WORDPRESS_API_URL')
59

610
// Set global state name.
711
export const APOLLO_STATE_PROP_NAME = '__APOLLO_STATE__'
@@ -17,7 +21,7 @@ export function createApolloClient() {
1721
return new ApolloClient({
1822
ssrMode: false,
1923
link: new HttpLink({
20-
uri: `${process.env.DEV_WORDPRESS_API_URL}graphql`,
24+
uri: `${wpApiUrlBase}graphql`,
2125
credentials: ''
2226
}),
2327
cache: new InMemoryCache()

0 commit comments

Comments
 (0)