Replies: 4 comments 3 replies
-
Why not just call |
Beta Was this translation helpful? Give feedback.
-
Use the "enabled" option if a query depends on a previous one before executing. This will let you do sequential queries. https://tanstack.com/query/latest/docs/react/guides/dependent-queries |
Beta Was this translation helpful? Give feedback.
-
If you just want to useQueries but execute all the queries in series, here's one approach to do it:
|
Beta Was this translation helpful? Give feedback.
-
Same approach but extracted to a hook, used to replace
Working example: https://stackblitz.com/edit/vitejs-usequeries-series-jqqmbu?file=src%2FApp.tsx Maybe |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
useQueries
is used to do an array of parallel queries, but I'm currently having a use case, that the query uses an external API service and I want to limit the request rate.Is there any way to query data sequentially?
The API takes an id as input, and there's a dynamic array of ids.
Beta Was this translation helpful? Give feedback.
All reactions