RFC: Smart-hydration of different queries #4328
iduuck
started this conversation in
RFC / Ideas
Replies: 1 comment 1 reply
-
Yes this is definitely a react-query thing, and I'm pretty sure it's possible already! You can setQueryData: https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientsetquerydata With tRPC it's also possible to get the query key to help with manipulation of this data. There is a code example here which may do what you need: https://trpc.io/docs/reactjs/getquerykey |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Disclaimer: I actually don't know an API for this as of now. But this just came into my mind while building something.
When building some sort of thing like you have a list, and then a detail page, when you click on the page.
When we say, there is a
blogPost.list
query on the list page. When navigating to the detail page of the blogpost, we could easily hydrate theblogPost.byId
query with the information we have from theblogPost.list
query and refetch in the background.I know, that this is somehow something for react-query, but don't know, if they would even tackle this.
Here is a minimal illustration of this:
Beta Was this translation helpful? Give feedback.
All reactions