diff --git a/examples/with-apollo/lib/apolloClient.js b/examples/with-apollo/lib/apolloClient.js index 554bcea87ded..b6aa661ce207 100644 --- a/examples/with-apollo/lib/apolloClient.js +++ b/examples/with-apollo/lib/apolloClient.js @@ -36,8 +36,8 @@ export function initializeApollo(initialState = null) { // Get existing cache, loaded during client side data fetching const existingCache = _apolloClient.extract() - // Merge the existing cache into data passed from getStaticProps/getServerSideProps - const data = merge(initialState, existingCache, { + // Merge the initialState from getStaticProps/getServerSideProps in the existing cache + const data = merge(existingCache, initialState, { // combine arrays using object equality (like in sets) arrayMerge: (destinationArray, sourceArray) => [ ...sourceArray,