Closed serendipity1004 closed 4 years ago
this is a very stupid mistake on my part.
for those of you having same problem the key name at below two codes must be identical for obvious reasons
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
I am following the example on using apollo with NextJS.
However, I am unable to get the data retrieved in server to be hydrated in the client.
In the line below, if I print
initialState
it is always null; therefore, the cache is not populated to the client side apollo. https://github.com/vercel/next.js/blob/19f3306aaadc00be1ba6d3521dfdeca49d7a95fe/examples/api-routes-apollo-server-and-client/apollo/client.js#L32-L36My client.tsx file looks like below
my index.tsx page looks like below
When I print
apolloClient.cache.extract()
I am getting a correct cache value; however, this is not passed on toinitialState
in theinitializeApollo
function.I am also using Material UI so
_document.tsx
and_app.tsx
are looking like below, respectively._document.tsx
_app.tsx
What should I do in order to have the SSR apollo cache populate the Client Side apollo cache?