Skip to content

[next-urql] Using SSR with both withUrqlClient and getServerSideProps #1091

Answered by JoviDeCroock
lukel97 asked this question in Q&A
Discussion options

You must be logged in to vote

They can't be used together for several reasons, the intent is different. With next-urql we want to enable you to resolve useQuery calls. We use the V-DOM tree to resolve the query-hooks you got there, this means that we have to add getInitialProps to the page to run a prepass on it.

If you want to use getServerSideProps you'll have to turn ssr: false that means we don't bind getInitialProps to the page component you are wrapping in withUrql and we'll instead just inject the Provider.

The choice comes down to:
do you want to have that one getServerSideProps call or do you want to resolve your full tree of useQuery?

We as authors of these libraries don't really have a lot of "power" over t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kitten
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants