# lukemorales/query-key-factory

A library for creating typesafe standardized query keys, useful for cache management in @tanstack/query

Repository: https://github.com/lukemorales/query-key-factory
Canonical: https://ross.abutalabs.com/products/query-key-factory
Homepage: https://www.npmjs.com/package/@lukemorales/query-key-factory
Language: TypeScript
License: MIT
License Family: permissive
Topics: cache, query, react, react-query, tanstack, tanstack-react-query, vue-query, query-keys, solid-query, svelte-query
Last push: 2024-12-29T23:35:37+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 1473, "days_push": 612, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1673, forks 50 (observed 2026-08-28T04:05:20.299388+00:00)

## What it is
A TypeScript library for creating typesafe, standardized query keys for TanStack Query (React Query, Vue Query, Solid Query, Svelte Query). It provides a query key store factory with auto-completion to simplify cache management and query invalidation.

## Use cases
- manage query keys in react-query without typos
- create typesafe query key factories for tanstack query
- invalidate queries by key across an app
- co-locate queryFn with query keys in a single store
- standardize cache keys across react, vue, svelte, and solid apps

## When to choose
- you use TanStack Query and want typesafe, auto-completed query keys
- your app has many queries and manual string keys cause bugs
- you want a single centralized query key store with attached queryFns

## When to avoid
- you don't use TanStack Query or a similar cache-key-based data fetching library
- your app has only a handful of simple queries where manual keys suffice

## Facets
- artifact type: library
- maturity: stable
- function: caching, state-management, developer-tools
- domain: frontend, web-development, developer-tools
- platform: browser, cross-platform
- tags: tanstack-query, react-query, query-keys, cache-management, typescript, vue-query, svelte-query, solid-query, nodejs

## Member repositories
- lukemorales/query-key-factory (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:20.299388+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:42:35.477588+00:00, confidence not recorded.
  - readme: https://github.com/lukemorales/query-key-factory (fetched 2026-08-28T04:05:20.299388+00:00, sha 57fbfe5b0794)
- Data as of 2026-08-30T08:39:29.467469+00:00.
