MCPcopy Index your code
hub / github.com/TanStack/query / setQueryDefaults

Method setQueryDefaults

packages/query-core/src/queryClient.ts:473–491  ·  view source on GitHub ↗
(
    queryKey: QueryKey,
    options: Partial<
      OmitKeyof<
        QueryObserverOptions<TQueryFnData, TError, TData, TQueryData>,
        'queryKey'
      >
    >,
  )

Source from the content-addressed store, hash-verified

471 }
472
473 setQueryDefaults<
474 TQueryFnData = unknown,
475 TError = DefaultError,
476 TData = TQueryFnData,
477 TQueryData = TQueryFnData,
478 >(
479 queryKey: QueryKey,
480 options: Partial<
481 OmitKeyof<
482 QueryObserverOptions<TQueryFnData, TError, TData, TQueryData>,
483 'queryKey'
484 >
485 >,
486 ): void {
487 this.#queryDefaults.set(hashKey(queryKey), {
488 queryKey,
489 defaultOptions: options,
490 })
491 }
492
493 getQueryDefaults(
494 queryKey: QueryKey,

Callers 15

Example6Function · 0.95
Example7Function · 0.95
Example8Function · 0.95
Example9Function · 0.95
Example10Function · 0.95
Example6Function · 0.95
Example7Function · 0.95
Example8Function · 0.95
Example9Function · 0.95
Example10Function · 0.95
Example6Function · 0.45
Example7Function · 0.45

Calls 1

hashKeyFunction · 0.90

Tested by

no test coverage detected