* 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,
)
| 276 | * ``` |
| 277 | */ |
| 278 | find< |
| 279 | TData = unknown, |
| 280 | TError = DefaultError, |
| 281 | TVariables = any, |
| 282 | TOnMutateResult = unknown, |
| 283 | >( |
| 284 | filters: MutationFilters, |
| 285 | ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined { |
| 286 | const defaultedFilters = { exact: true, ...filters } |
| 287 | |
| 288 | return this.getAll().find((mutation) => |
| 289 | matchMutation(defaultedFilters, mutation), |
| 290 | ) as Mutation<TData, TError, TVariables, TOnMutateResult> | undefined |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * An even more advanced method that can be used to get existing mutation instances from the |
no test coverage detected