-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Description
Hi,
I've been looking at the code and doing some experiments myself. While I do not have an issue, I'd like to learn about some details (sorry if I missed something in the code thoguh, not really familiar with the apollo internals);
- Why do we need
useTransportValue
and keeping track of hook returns? It looks like as long as the cache is populated, on the client side, the return values will be consistent with the server. Is this for cases like auseSuspendQuery
running first, populating some cache anduseQuery
somewhere else running the same query? - It looks like due to
transportedValues
and theincomingResults
will duplicate almost every result. Any chance to avoid this? - How would this behave if there are more than one provider on the page?
transportedValues
haveuseId
keys so they should be fine butincomingResults
would not work (I assume). Any chance to keep track of multipleApolloRehydrationContext
instances also usinguseId
or something like that? I guessuseRehydrationContext
could also receive an id parameter fromuseTransportValue
and only restore the cache entries belonging to that id? That should also solve the keeping track of transportValues I guess? Cache would be consistent with whatever happened on server if eachuseTransportValue
call would restore specific cache belonging to that id.
Also, the beta client exports useSuspenseQuery
without _experimental
suffix now.