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

Method get

packages/query-core/src/queryCache.ts:250–261  ·  view source on GitHub ↗

* Returns the `Query` instance stored under the given `queryHash`, or `undefined` if none * exists. Unlike QueryCache#find, this looks up by the already-computed hash rather * than by `QueryFilters`. Used by plugins (e.g. broadcast/hydration) that already have a hash * to look up di

(
    queryHash: string,
  )

Source from the content-addressed store, hash-verified

248 * ```
249 */
250 get<
251 TQueryFnData = unknown,
252 TError = DefaultError,
253 TData = TQueryFnData,
254 TQueryKey extends QueryKey = QueryKey,
255 >(
256 queryHash: string,
257 ): Query<TQueryFnData, TError, TData, TQueryKey> | undefined {
258 return this.#queries.get(queryHash) as
259 | Query<TQueryFnData, TError, TData, TQueryKey>
260 | undefined
261 }
262
263 /**
264 * Returns all queries within the cache.

Callers 15

buildMethod · 0.95
queryFnFunction · 0.80
queryFnFunction · 0.80
queryFnFunction · 0.80
queryFnFunction · 0.80
isQueryResultCallFunction · 0.80
PropertyFunction · 0.80
willUpdateMethod · 0.80

Calls

no outgoing calls

Tested by 4

stubPipWindowFunction · 0.64
getFreshStorageFunction · 0.64
getItemFunction · 0.64
setItemFunction · 0.64