# TanStack Query: 9.0 out of 10

The default choice. 1st of 10 in [State and data fetching](https://elestia.ai/opensource/state-and-data/index.md).

TanStack Query is the leading library for fetching, caching and syncing server data in React, with bindings for Vue, Solid, Svelte and Angular. For a new app that talks to an API, it is the default choice today. Pair it with a small client-state store such as Zustand if you also need one.

**Best for:** Any React or other front-end team that needs cached, fresh server data, with mutations, pagination and SSR hydration, from REST or RPC APIs.

## Scores

- **Overall: 9.0** (likely 7.9 to 9.6)
  - Claude Opus 5.5 (9.0): It is the category's default for server state: the deepest feature set, very active upkeep, the strongest survey standing, and growth above the median. It does not replace a client-state store, and the 2026 org-level supply-chain incident keeps it below a perfect score. Among its peers it ranks first for data fetching, alongside Zustand for client state.
  - GPT-6.2 Sol (8.9): TanStack Query is my default for new React apps that need a client-side server data cache with mutations and background refreshes. Active maintenance and production use support that choice. SWR has an appeal for small bundles, and RTK Query fits teams that already organize app state around Redux. The range reflects how much the app needs those tradeoffs and how much shared UI state it must manage separately.
- **Needed by many: 7.0** (likely 6.0 to 8.1)
  - Claude Opus 5.5 (7.0): Most web apps fetch server data and benefit from caching it, so a large share of front-end developers need this job done. The rated package is React-only. The repository also serves Vue, Solid, Svelte and Angular. It does not cover general client state, which is narrower than the full category.
  - GPT-6.2 Sol (7.0): Keeping API data fresh is a common need in interactive web and mobile apps. The measured package serves React and React Native, and the larger project also ships adapters for Vue, Solid, Svelte, and Angular. The range reflects how often built-in framework fetching is sufficient and how much an app relies on shared client-side state.
- **Helps a lot: 9.0** (likely 7.9 to 9.8)
  - Claude Opus 5.5 (9.0): It is the most complete server-state tool in the category: caching, staleness control, mutations, infinite queries, SSR hydration, offline persistence and devtools. Its types are strong, its documentation is extensive, and AI agents write it correctly because the patterns are so common. Comparisons favour it over SWR for mutations, and it lacks only a normalized cache.
  - GPT-6.2 Sol (8.9): Stable React Query 5.108.2 handles caching, pagination, retries, and optimistic updates with strong type inference. The docs give coding agents a clear API to follow, though choosing query keys and invalidating data correctly still requires app context. A recent benchmark found similar first-fetch times and a smaller bundle for SWR on the tested imports. An open report of stale combined query results leaves some uncertainty around complex subscriptions.
- **Holds up over time: 8.9** (likely 7.8 to 9.8)
  - Claude Opus 5.5 (9.0): The repository had 1,897 commits last year, has 1,154 contributors, and only 42 issues are open. Releases are frequent and there is a long-running team behind it. TanStack is funded by sponsors and partners, and v5 has stayed stable for years, with v6 work only exploratory. The ecosystem is moving toward the wider TanStack family, not away from it.
  - GPT-6.2 Sol (8.8): The React package published 82 versions in a year, and recent core fixes show active maintenance by several contributors. TanStack reports funding from sponsors, partnerships, and companies that use its tools. The v5 upgrade required downstream projects to replace query callbacks, and patch releases can change types. Public release and issue records leave uncertainty about typical response times and how many maintainers can authorize releases.
- **Used widely: 8.3** (likely 7.0 to 9.3)
  - Claude Opus 5.5 (9.0): It had about 338M downloads in 4 weeks, up 6.9x on a year before. That is well above the 4.1 median, and only Zustand is close. Some installs come in through TanStack Router, tRPC and code generators. The 21,873 dependent repos are fewer than Redux Toolkit's or Zustand's, probably partly because the package is scoped and newer, but the trend and surveys show it is widely chosen.
  - GPT-6.2 Sol (7.5): Four-week downloads grew 6.89× year over year, above the 4.1× catalog baseline and roughly even with Zustand. Ecosyste.ms tracks 21,873 repositories and 1,082 packages, with fewer tracked repositories than Redux Toolkit, Zustand, or SWR. Automated and downstream installs inflate npm counts, while stars and Bluesky links cover the whole Query monorepo. The download trend and survey both point to growth, with incomplete repository coverage leaving the number of direct choices uncertain.
- **Vouched for: 9.0** (likely 8.0 to 9.9)
  - Claude Opus 5.5 (9.0): It ranked first among libraries in State of React 2024 and again in 2025, with strong positive and very low negative sentiment. Independent comparisons recommend it, and tRPC, Orval, hey-api and TanStack Router build on it. Survey samples are self-selected, so the range stays one point wide.
  - GPT-6.2 Sol (9.0): TanStack Query led satisfaction among the data-loading libraries in State of React 2025. Bluesky uses it in its feed and Supabase Studio ships it in its dashboard. Refine v5 builds its data hooks on it, and an independent benchmark adds evidence on bundle size and fetch performance. The survey samples React developers, and the benchmark covers a narrow set of workloads.
- **Safe: 7.9** (likely 6.7 to 8.8)
  - Claude Opus 5.5 (7.0): It has no advisories, one dependency and an MIT licence. In May 2026, attackers used cache poisoning and OIDC token theft in TanStack's CI to publish malicious versions of 42 Router and Start packages. The postmortem confirms the Query packages were clean, and the CI was hardened afterwards. There is no Scorecard data, and the incident shows real org-level supply-chain risk.
  - GPT-6.2 Sol (8.7): The MIT-licensed React package has one runtime dependency, TanStack Query Core, and the bundle shows zero OSV advisories. Query’s release workflow uses GitHub Actions with short-lived credentials for npm publishing. The May compromise affected TanStack Router and Start packages, and the August incident affected a third-party code generator. The missing OpenSSF Scorecard and limited visibility into release permissions widen the range.

## Good

- Caching, background refetch, deduplication, retries, infinite queries and optimistic mutations all work out of the box with sensible defaults.
- TypeScript types are excellent, and queryOptions makes keys and data types reusable and safe.
- Very active upkeep: v5 has had no breaking major in years, and maintainers close issues fast (42 open of about 2,400).
- Adapters for React, Vue, Solid, Svelte and Angular, plus devtools and a large ecosystem of code generators (Orval, hey-api, tRPC).

## Bad

- It manages server state only, so purely client-side state still needs another tool.
- No normalized cache, so related queries must be invalidated by hand, unlike Apollo for GraphQL.
- The bundle is larger than SWR's, at about 13 KB gzipped against about 4 KB.
- In May 2026 attackers published malicious versions of 42 @tanstack packages through the shared org's CI. Query packages were confirmed clean, but the incident shows org-level risk.

## The numbers

- Downloads, 4 weeks: 338M
- In a year: ×6.9
- GitHub stars: 51k
- Commits, 12 months: 1.9k
- Last npm release: Nov 2026
- Advisories, 24 months: 0
- Licence: MIT
- GitHub: https://github.com/TanStack/query
- npm: https://www.npmjs.com/package/@tanstack/react-query

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
