Skip to content

read cache on from server #1193

Answered by JoviDeCroock
vincehi asked this question in Q&A
Dec 4, 2020 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

No entirely sure what you're meaning to do, however there are a few scenario's that come to mind. In a typical server-side rendering scenario we'll use the ssrExchange.

This is an exchange we'll use both on the server and the client, when used on the server we'll call extractData and it to a <script> tag on the window so we get the data-shape you describe:

{ [operation.key]: operationResult }

When you use this exchange on the client this will hydrate your local-cache with everything you have fetched on the server, this means that if you call useQuery on the client you'll get a synchronous result (won't hit your server with the fetchExchange) and this entry will now live in the client-sid…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@viiiprock
Comment options

@JoviDeCroock
Comment options

@viiiprock
Comment options

@JoviDeCroock
Comment options

@viiiprock
Comment options

Answer selected by kitten
Comment options

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