MCPcopy
hub / github.com/TanStack/query / find

Method find

packages/query-core/src/mutationCache.ts:204–217  ·  view source on GitHub ↗
(
    filters: MutationFilters,
  )

Source from the content-addressed store, hash-verified

202 }
203
204 find<
205 TData = unknown,
206 TError = DefaultError,
207 TVariables = any,
208 TOnMutateResult = unknown,
209 >(
210 filters: MutationFilters,
211 ): Mutation<TData, TError, TVariables, TOnMutateResult> | undefined {
212 const defaultedFilters = { exact: true, ...filters }
213
214 return this.getAll().find((mutation) =>
215 matchMutation(defaultedFilters, mutation),
216 ) as Mutation<TData, TError, TVariables, TOnMutateResult> | undefined
217 }
218
219 findAll(filters: MutationFilters = {}): Array<Mutation> {
220 return this.getAll().filter((mutation) => matchMutation(filters, mutation))

Callers 2

canRunMethod · 0.45
runNextMethod · 0.45

Calls 2

getAllMethod · 0.95
matchMutationFunction · 0.90

Tested by

no test coverage detected