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

Method setQueryDefaults

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

Source from the content-addressed store, hash-verified

459 }
460
461 setQueryDefaults<
462 TQueryFnData = unknown,
463 TError = DefaultError,
464 TData = TQueryFnData,
465 TQueryData = TQueryFnData,
466 >(
467 queryKey: QueryKey,
468 options: Partial<
469 OmitKeyof<
470 QueryObserverOptions<TQueryFnData, TError, TData, TQueryData>,
471 'queryKey'
472 >
473 >,
474 ): void {
475 this.#queryDefaults.set(hashKey(queryKey), {
476 queryKey,
477 defaultOptions: options,
478 })
479 }
480
481 getQueryDefaults(
482 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