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

Method setQueryDefaults

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

Source from the content-addressed store, hash-verified

547 }
548
549 setQueryDefaults<
550 TQueryFnData = unknown,
551 TError = DefaultError,
552 TData = TQueryFnData,
553 TQueryData = TQueryFnData,
554 >(
555 queryKey: QueryKey,
556 options: Partial<
557 OmitKeyof<
558 QueryObserverOptions<TQueryFnData, TError, TData, TQueryData>,
559 'queryKey'
560 >
561 >,
562 ): void {
563 this.#queryDefaults.set(hashKey(queryKey), {
564 queryKey,
565 defaultOptions: options,
566 })
567 }
568
569 getQueryDefaults(
570 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