922 B
922 B
id, title
| id | title |
|---|---|
| matchMutation | matchMutation |
function matchMutation(filters, mutation): boolean;
Defined in: packages/query-core/src/utils.ts:237
Checks whether a mutation matches the given MutationFilters.
Every filter that is specified must match; filters that are left unspecified are ignored.
If a mutationKey filter is provided but the mutation has no mutationKey of its own, it does not match.
Parameters
filters
mutation
Mutation<any, any>
Returns
boolean
Example
const mutationCache = queryClient.getMutationCache()
const matchingMutations = mutationCache
.getAll()
.filter((mutation) => matchMutation({ mutationKey: ['addPost'] }, mutation))