MCPcopy Create free account
hub / github.com/TanStack/query / setQueriesData

Method setQueriesData

packages/query-core/src/queryClient.ts:209–228  ·  view source on GitHub ↗
(
    filters: TQueryFilters,
    updater: Updater<
      NoInfer<TQueryFnData> | undefined,
      NoInfer<TQueryFnData> | undefined
    >,
    options?: SetDataOptions,
  )

Source from the content-addressed store, hash-verified

207 }
208
209 setQueriesData<
210 TQueryFnData,
211 TQueryFilters extends QueryFilters<any> = QueryFilters,
212 >(
213 filters: TQueryFilters,
214 updater: Updater<
215 NoInfer<TQueryFnData> | undefined,
216 NoInfer<TQueryFnData> | undefined
217 >,
218 options?: SetDataOptions,
219 ): Array<[QueryKey, TQueryFnData | undefined]> {
220 return notifyManager.batch(() =>
221 this.#queryCache
222 .findAll(filters)
223 .map(({ queryKey }) => [
224 queryKey,
225 this.setQueryData<TQueryFnData>(queryKey, updater, options),
226 ]),
227 )
228 }
229
230 getQueryState<
231 TQueryFnData = unknown,

Callers 10

WithKnownParametersFunction · 0.45
WithKnownParametersFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45
ExamplesFunction · 0.45

Calls 2

setQueryDataMethod · 0.95
findAllMethod · 0.45

Tested by

no test coverage detected