Some queries are fetched multiple times not using the cached query
In my current project some queries are executed multiple times, fetching data again without using the cached data from react-query, I have analyzed the props in the data hooks that are used and they are the same, but it seems some rerenders cause the queries to fetch again
5 Replies
Hi @rafaelsorto. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the React Query documentation (https://react-query.tanstack.com/guides/dependent-queries) for more information on dependent queries and query invalidation. This might help you understand why your queries are being refetched and how to optimize them.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------<@675886119006634036> kapa.ai is still learning and improving, please let us how it did by reacting below
xenophobic-harlequinOP•2y ago
How do you configure the data related hooks in refine to improve caching times for the underlying react-query hooks
genetic-orange•2y ago
Hello @rafaelsorto do you have this issue on deploy version as well? Please check the FAQ answer here:
https://refine.dev/docs/faq/#why-are-api-calls-triggering-twice
FAQ | refine
How can I change the form data before submitting it to the API?
xenophobic-harlequinOP•2y ago
Oh OK I will compare between Development and Production thanks for the link @batuhanw I did a search on the docs and couldn't find anything related to this issue