Skip to content
Discussion options

You must be logged in to vote

Thanks for the feedback, this is an interesting use case! So what you need is a way to keep track of which queries were fetched in this particular request so that you can dehydrate only those? Sounds like a very classic SSR problem. 😁

I think the solution you came up with is a good one. 😄 I guess what you could do to simplify it a bit is to wrap prefetchQuery with your own function that takes care of the requestLog-stuff behind the scenes.

A slightly different/expanded approach that could be generalized into a third party library would be to create a kind of full proxy for that shared cache, and in that proxy keep track of which queries has been accessed. Something like const proxyCache =…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@PepijnSenders
Comment options

Answer selected by Ephem
Comment options

You must be logged in to vote
1 reply
@escaton
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants