* A slightly more advanced method that can be used to get an existing mutation instance from * the cache. If the mutation does not exist, `undefined` is returned. * * This is not typically needed for most applications, but can come in handy when needing more * information about a mutatio
(
filters: MutationFilters,
)
| 317 | * ``` |
| 318 | */ |
| 319 | find< |
| 320 | TData = unknown, |
| 321 | TError = DefaultError, |
| 322 | TVariables = any, |
| 323 | TOnMutateResult = unknown, |
| 324 | >( |
| 325 | filters: MutationFilters, |
| 326 | ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined { |
| 327 | const defaultedFilters = { exact: true, ...filters } |
| 328 | |
| 329 | return this.getAll().find((mutation) => |
| 330 | matchMutation(defaultedFilters, mutation), |
| 331 | ) as Mutation<TData, TError, TVariables, TOnMutateResult> | undefined |
| 332 | } |
| 333 | |
| 334 | /** |
| 335 | * An even more advanced method that can be used to get existing mutation instances from the |
no test coverage detected