-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Milestone
Description
Would it be possible to add support for fuzzy matching against args in the utility updateQueryData? There are instances where I want to change on all cached endpoints of a query regardless of what args they are cached on.
For example here the getTransactions
query also have a type
argument but I simply do not core what the value is. I only care updating where both companyDomain and planId matches.
const patchResult = dispatch(
myApi.util.updateQueryData(
"getTransactions",
{ companyDomainId, planId },
(draft) => {
Object.assign(draft, updatedTransactions);
}
)
);
I'm thinking of something like how I match objects in vitest: expect.objectContaining({ companyDomainId, planId, type: expect.any() }),
My workaround is to just pass everything I need as arguments for this query but it feels a bit cumbersome to have to do it just because I need it on my onQueryStarted
method.