How to treat the data before passing the data?
Hi!
I would like to make a query with useQuery and within useQuery itself handle the response and modify the data structure, something like redux thunk can do.
I understand that the "select" property does something similar, but it doesn't cache. Is there another property I'm not seeing that can make this modification and cache save? Or a more optimized way for me to do this?
2 Replies
correct-apricot•4y ago
You can just do that inside of the query function.
Use an asynchrony function, await your dat from its source, transform it and return it. Whatever you return will be cached
genetic-orangeOP•4y ago
That makes sense. Now my question seems silly. I think I got too much in the box. Thank you for opening another path for me!