MCPcopy
hub / github.com/TanStack/query / hashQueryKeyByOptions

Function hashQueryKeyByOptions

packages/query-core/src/utils.ts:204–210  ·  view source on GitHub ↗
(
  queryKey: TQueryKey,
  options?: Pick<QueryOptions<any, any, any, any>, 'queryKeyHashFn'>,
)

Source from the content-addressed store, hash-verified

202}
203
204export function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(
205 queryKey: TQueryKey,
206 options?: Pick<QueryOptions<any, any, any, any>, 'queryKeyHashFn'>,
207): string {
208 const hashFn = options?.queryKeyHashFn || hashKey
209 return hashFn(queryKey)
210}
211
212/**
213 * Default query & mutation keys hash function.

Callers 5

defaultQueryOptionsMethod · 0.90
buildMethod · 0.90
utils.test.tsxFile · 0.90
query.test.tsxFile · 0.90
matchQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…