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

Method get

packages/query-core/src/queryCache.ts:277–288  ·  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

275 * ```
276 */
277 get<
278 TQueryFnData = unknown,
279 TError = DefaultError,
280 TData = TQueryFnData,
281 TQueryKey extends QueryKey = QueryKey,
282 >(
283 queryHash: string,
284 ): Query<TQueryFnData, TError, TData, TQueryKey> | undefined {
285 return this.#queries.get(queryHash) as
286 | Query<TQueryFnData, TError, TData, TQueryKey>
287 | undefined
288 }
289
290 /**
291 * 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