Best practice for reusing result of list
request for byId
requests
#1139
Unanswered
PepijnSenders
asked this question in
Q&A
Replies: 1 comment
-
You can put the result from the list query into the detail query as https://react-query.tanstack.com/docs/guides/initial-query-data#initial-data-from-cache Alternatively, you can just call https://react-query.tanstack.com/docs/guides/prefetching#manually-priming-a-query |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you do a request to for example
/characters
and then you do a request to for example/characters/1
, is there a way to reuse the result of the list command for/characters/1
? My use case is a bit more complex and I'm considering setting each "character" on theonSuccess
callback of the/characters
request. Anyone else have a better method for doing this?Beta Was this translation helpful? Give feedback.
All reactions