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

Function hashQueryKeyByOptions

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

Source from the content-addressed store, hash-verified

264}
265
266export function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(
267 queryKey: TQueryKey,
268 options?: Pick<QueryOptions<any, any, any, any>, 'queryKeyHashFn'>,
269): string {
270 const hashFn = options?.queryKeyHashFn || hashKey
271 return hashFn(queryKey)
272}
273
274/**
275 * Default query & mutation keys hash function.

Callers 6

defaultQueryOptionsMethod · 0.90
buildMethod · 0.90
utils.test-d.tsxFile · 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