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

Commit 60cf904

Browse files
committed
Use wp apollo instance
1 parent 4924190 commit 60cf904

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/apolloConfig.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {useMemo} from 'react'
22
import merge from 'deepmerge'
33
import isEqual from 'lodash/isEqual'
4+
import {initializeWpApollo} from './wordpress/connector'
45

56
// Set global state name.
67
export const APOLLO_STATE_PROP_NAME = '__APOLLO_STATE__'
@@ -61,6 +62,7 @@ export function addApolloState(client, pageProps) {
6162
*/
6263
export function useApollo(pageProps) {
6364
const state = pageProps[APOLLO_STATE_PROP_NAME]
64-
const store = useMemo(() => initializeApollo(state), [state])
65+
// Use WP Apollo instance by default.
66+
const store = useMemo(() => initializeWpApollo(state), [state])
6567
return store
6668
}

0 commit comments

Comments
 (0)