Need help to find out why my query is not marked as stale
Hey guys, I don't understand what I am doing wrong. Maybe it is just some async stuff.
I have one query to fetch some bank data. On top of that I have written some more queries which filter the list of bank data I am getting. Once I am posting new data I want to invalidate all filters and the initial query which gets the data. However, one query is always using initial data set and not the updated data set.
2 Replies
secure-lavenderOP•2y ago
The issue arises after a mutation:
stormy-gold•2y ago
Possibly await invalidation of allPaymentDetails is a fix
But to improve in general: the queryKey of useCurrentPaymentDetails must contain the value of allPaymentDetails
You should look up the concept of dependent queries.