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

Commit 4924190

Browse files
committed
Move check to wp init
1 parent 4a57567 commit 4924190

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/apolloConfig.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ export function initializeApollo(apolloClient, initialState = null) {
3535
apolloClient.cache.restore(data)
3636
}
3737

38-
// For SSG and SSR always create a new Apollo Client.
39-
if (typeof window === 'undefined') return apolloClient
40-
4138
return apolloClient
4239
}
4340

api/wordpress/connector.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export function initializeWpApollo(initialState = null) {
3939

4040
const newApolloClient = initializeApollo(_apolloClient, initialState)
4141

42+
// For SSG and SSR always create a new Apollo Client.
43+
if (typeof window === 'undefined') return newApolloClient
44+
4245
// Create the Apollo Client once in the client.
4346
if (!wpApolloClient) wpApolloClient = newApolloClient
4447

0 commit comments

Comments
 (0)