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

Function hashQueryKeyByOptions

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

Source from the content-addressed store, hash-verified

218}
219
220export function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(
221 queryKey: TQueryKey,
222 options?: Pick<QueryOptions<any, any, any, any>, 'queryKeyHashFn'>,
223): string {
224 const hashFn = options?.queryKeyHashFn || hashKey
225 return hashFn(queryKey)
226}
227
228/**
229 * 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