-
Is it possible to prefetch dependent queries? I want to use SSR in Next.js for a page but my the first So if I prefetch I need to wait for the first query to finish before I could run the second. This is what I'm doing now with regular client-side rendering, the page
I tried only prefetching the first query using hydration but once the page loads, if I try to navigate to another SSR page, the data from the second query clears and triggers an error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
you'd await the prefetch of query1, then get the data from the query cache, then prefetch query2, then dehydrate the whole client (which would then contain results for both queries) |
Beta Was this translation helpful? Give feedback.
you'd await the prefetch of query1, then get the data from the query cache, then prefetch query2, then dehydrate the whole client (which would then contain results for both queries)