next-with-apollo
next-with-apollo copied to clipboard
Option to use `getDataFromTree` also on client?
Currently, getDataFromTree
works only during SSR due to this condition:
https://github.com/lfades/next-with-apollo/blob/e0ddc5a628e33d4bac6e877dc2240e02e3a101a9/src/withApollo.tsx#L69
On the client, you'll see "Loading..." due to this, which is not bad but an alternative UX that we actually prefer is to wait for all data to load and only then change the route, sort of like with turbolinks.
To achieve that, we maintain a fork of with-apollo but that is own drawbacks, obviously. Would this project consider accepting a PR that would make this configurable, like this?
export default withApollo(Index, { getDataFromTree, useGetDataFromTreeAlsoOnClient: true });
(Naming it will be challenging 😄.)
Hey, can I get access to the fork repo. This issue is just annnoying.
Before this can work this Next.js issue will need to be fixed: https://github.com/vercel/next.js/issues/10126 / https://github.com/vercel/next.js/issues/9336
Maybe clientPrepass: true
? It should be something short anyways 😄
clientSidePreload: true