Interesting video from the CodePen podcast in which Shaw goes over this approach to SSR with Next and Apollo:
A probably-better approach is to use the
getDataFromTreemethod, which walks down the tree and executes the queries to fill up the ApolloClient cache.
- Create a shared
- Render the page using
getDataFromTree()to fill the cache with data
- Render the page again with that data using Next’s
- Extract the cache to deliver with the page and hydrate the client-side Apollo cache