# TanStack/query

🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.

Repository: https://github.com/TanStack/query
Canonical: https://ross.abutalabs.com/products/query
Homepage: https://tanstack.com/query
Language: TypeScript
License: MIT
License Family: permissive
Topics: react, hooks, fetch, cache, async, rest, graphql, data, query, stale, stale-while-revalidate, update, solid, svelte, typescript, vue
Last push: 2026-08-26T18:36:20+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 87, longevity 100
- inputs: {"age_days": 2549, "days_push": 7, "days_rel": 6, "gap_med": 0, "n_releases_24m": 1510}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 50211, forks 4195 (observed 2026-08-28T04:12:11.761642+00:00)

## What it is
TanStack Query (formerly React Query) is a TypeScript library for asynchronous state management that handles fetching, caching, synchronizing, and updating server state in web applications. It provides declarative hooks and adapters for React, Vue, Solid, Svelte, Angular, Lit, and Preact, with built-in caching, retries, deduplication, and background refetching.

## Use cases
- fetch and cache API data in React
- manage server state in a web app
- implement infinite scroll and pagination
- refetch data on window focus
- handle optimistic updates after mutations
- deduplicate duplicate API requests
- prefetch data for routes
- replace Redux for async data

## When to choose
- your app relies heavily on remote/server data that needs caching and revalidation
- you want retries, deduplication, and background refetching out of the box
- you use React, Vue, Solid, Svelte, Angular, or Lit and want typed async state hooks
- you need pagination, infinite queries, or offline mutation queues

## When to avoid
- you only manage local client-side UI state with no server data
- you need a full global state store for complex client state (combine with a state library)
- your project cannot adopt its opinionated defaults and cache lifecycle
- you work outside the supported JS frameworks

## Facets
- artifact type: library
- maturity: stable
- function: state-management, http-client, caching, middleware
- domain: frontend, web-development, apis
- platform: browser, cross-platform
- tags: react-query, server-state, data-fetching, async-state, stale-while-revalidate, hooks, vue, svelte, solid, angular, typescript, nodejs, web-server

## Member repositories
- TanStack/query (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:12:11.761642+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-29T16:19:56.876748+00:00, confidence not recorded.
  - readme: https://github.com/TanStack/query (fetched 2026-08-28T04:12:11.761642+00:00, sha c8fe19d2c823)
  - homepage: https://tanstack.com/query (fetched 2026-08-28T18:12:09.333679+00:00, sha 36b2a30181bd)
  - site_page: https://tanstack.com/query/latest/docs/framework/react/overview (fetched 2026-08-28T18:12:09.344189+00:00, sha 0e50d82f9263)
  - site_page: https://tanstack.com/query/latest/docs/framework/react/guides/important-defaults (fetched 2026-08-28T18:12:09.346013+00:00, sha 4aea6d62ced4)
  - site_page: https://tanstack.com/query/latest/docs/reference/QueryClient (fetched 2026-08-28T18:12:09.347754+00:00, sha bf4797201814)
  - site_page: https://tanstack.com/query/latest/docs/framework/react/examples/simple (fetched 2026-08-28T18:12:09.349672+00:00, sha f313f1304ac8)
  - site_page: https://tanstack.com/query/latest/docs/blog (fetched 2026-08-28T18:12:09.351153+00:00, sha 7742c2010223)
  - site_page: https://tanstack.com/query/latest/docs/framework (fetched 2026-08-28T18:12:09.353009+00:00, sha 4eca16a4bb9f)
  - site_page: https://tanstack.com/query/latest/docs/contributors (fetched 2026-08-28T18:12:09.354561+00:00, sha e301522bb098)
  - site_page: https://tanstack.com/blog (fetched 2026-08-28T18:12:09.342355+00:00, sha f45f670c0ce6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
