How can i fetch query inside a loop and push back data for each iteration?
Exmaple:
Please help. I will be grateful for your help
2 Replies
fair-roseOP•3y ago
help plz
other-emerald•3y ago
Maybe fetchQuery or can help you?
https://tanstack.com/query/v4/docs/reference/QueryClient#queryclientfetchquery
const data = await queryClient.fetchQuery({ queryKey, queryFn })
Or ParallellQueries
https://tanstack.com/query/v4/docs/guides/parallel-queries#dynamic-parallel-queries-with-usequeries
Depends on the rest of your code