Skip to content
Discussion options

You must be logged in to vote

getQueryData gets the data from the cache. There is only one structure in the cache. The select option is "per observer", so every useQuery call can transform data like they see fit, and additionally, only subscribe to the transformation result.

getQueryData doesn't create a subscription, so a selector is unnecessary. You can just do:

const cachedData = queryClient.getQueyData(...)
const transformedData = transformData(cachedData)

Replies: 1 comment

Comment options

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