Equivalent for readFragment
for retrieving node data from cache
#1338
-
Hey! Do you think you'll provide a "readFragment" exposed via useClient? My use case is having an abstraction to read from the urql cache but using an API like:
but I see why you wouldn't provide that as this result could be not cached. What do you think is a good way to achieve this so:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, If you are using graphCache this is possible through the resolvers api. When we have a user in cache through a list query,... we can hook up the details query like this https://formidable.com/open-source/urql/docs/graphcache/computed-queries/#resolve (scroll down to the todo key) We have had an RFC for a relay-like We chose not to attach it to the client because this won't work with a document-cache. |
Beta Was this translation helpful? Give feedback.
Hey,
If you are using graphCache this is possible through the resolvers api. When we have a user in cache through a list query,... we can hook up the details query like this https://formidable.com/open-source/urql/docs/graphcache/computed-queries/#resolve (scroll down to the todo key)
We have had an RFC for a relay-like
useFragment
but ended up deciding against it.We chose not to attach it to the client because this won't work with a document-cache.