Use useQuery(..., { ssr: false }) anywhere, and use SSR.
I've created a reproduction using react-apollo-error-template but I had to downgrade to apollo-client (rather than @apollo/client) because the SSR documentation refers to things that don't seem to be available in @apollo/client yet. This has also required adding a few more dependencies, sorry for the noise - I kept it as minimal as the Apollo SSR documentation would allow me.
See #3418 for this previously reported (with more users seeing the issue); this issue has a reproduction using the error template.
Intended outcome:
useQuery(query, { ssr: false })
runs on the client side on page load in an SSR application.Actual outcome:
The GraphQL request is never issued to the server and
loading
never becomes false.How to reproduce the issue:
Use
useQuery(..., { ssr: false })
anywhere, and use SSR.I've created a reproduction using
react-apollo-error-template
but I had to downgrade to apollo-client (rather than@apollo/client
) because the SSR documentation refers to things that don't seem to be available in@apollo/client
yet. This has also required adding a few more dependencies, sorry for the noise - I kept it as minimal as the Apollo SSR documentation would allow me.https://github.com/benjie/react-apollo-error-template/tree/ssr-false
Version
This is using the reproduction above (npm)
The
envinfo
script doesn't seem to output any package results in our actual monorepo.