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
Uh oh!
There was an error while loading. Please reload this page.
-
When you do a request to for example
/charactersand 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 theonSuccesscallback of the/charactersrequest. Anyone else have a better method for doing this?Beta Was this translation helpful? Give feedback.
All reactions