mrkeyoor.com_
Sun 04 Oct 07:04 UTC
Webevaluationupdated 27 Aug 2026

query review

TanStack Query is a client-side async-state library that fetches, caches, refreshes, and updates server data in web applications. It supplies framework adapters for React, Vue, Solid, Svelte, Angular, Preact, and Lit while leaving the transport choice to the application.

+19stars / 7d
Verdict

Our TanStack Query run built in 9 seconds and passed all 1,736 tests, but contributor setup installed 2,840 packages and consumed 2,198 MB. Use it for applications whose remote data has real caching, refresh, mutation, and pagination rules, especially across supported UI frameworks. Keep plain fetch for small pages, and choose a GraphQL-specific client when normalized entity caching is the requirement.

We ran it

Lab card: what happened when we ran queryScreenshot of query (tanstack.com/query)
Install✓ · 58s2840 packages · 2198 MB
Build✓ · 9s
Tests✓ · 897s1736 passed · 0 failed of 1736 (vitest)
Repo2333 files~180,710 lines of source · 26.3 MB · 4 CI workflows

Answers from our run

Does query build from source?

Dependencies installed in 58 seconds (2840 packages), and the build succeeded in 9 seconds. We cloned commit 96f2da6 into a clean Debian container with 3 CPUs and no project-specific setup.

Do query's tests pass?

Yes: 1736 of 1736 passed when we ran the project's own test command (vitest). Some failures need services or credentials a bare container does not have.

Who should not use query?

Applications needing a network client: the README calls the library protocol agnostic, so you still provide fetch, GraphQL, or another promise-returning function.

What are the alternatives to query?

SWR, Redux Toolkit, Apollo Client. Our TanStack Query run built in 9 seconds and passed all 1,736 tests, but contributor setup installed 2,840 packages and consumed 2,198 MB.

Setup4/5App install is focused; contributor workspace consumes 2,198 MB
Docs5/5Concept and framework guides cover cache behavior in detail
Community5/550,210 stars with releases and pull requests on August 26
Maturity5/5All 1,736 tests passed across an actively released monorepo

Discussed on

  1. hnTanStack Query(a.k.a. React Query) v5 announced62 points
  2. hnPopular code generator for TanStack Query hit by supply chain worm5 points
  3. hnShow HN: TanStack DB – Reactive DB with Differential Dataflow for TanStack Query4 points
  4. hnReact Query4 points
  5. hnHow to Build an API-First Front End with OpenAPI, Orval, TanStack Query, Zod3 points

Who it’s for

Frontend teams repeatedly loading remote data and managing stale or background refresh behavior.
Applications that need pagination, infinite queries, mutations, cancellation, or request deduplication.
Multi-framework organizations that want a shared query core with adapter-specific APIs.
Teams willing to define query keys and cache policy as part of application design.

Who it’s NOT for

Applications needing a network client: the README calls the library protocol agnostic, so you still provide fetch, GraphQL, or another promise-returning function.
Developers trying to store all client state in one place: TanStack Query is specifically for server state, not form fields, editor drafts, or arbitrary UI state.
Small sites with a handful of static requests where browser fetch and framework primitives already make the data flow obvious.
Contributors with tight disk or CI budgets: our monorepo install added 2,840 packages and occupied 2,198 MB before an 897-second test run.
Teams unwilling to test each framework adapter they ship: the latest release contains separate package lines and same-day fixes across React, Preact, and Solid behavior.

Setup reality

Our pnpm sandbox installed 2,840 packages in 58 seconds and used 2,198 MB on disk. The monorepo build passed in 9 seconds. Vitest then passed all 1,736 counted tests in 897 seconds with 0 failures.

Using a published adapter needs no service or credential beyond the API your application already calls. The application supplies the query function, query keys, client provider, retry policy, freshness rules, and any persistence or developer-tools packages it chooses.

The contributor checkout is a 2,333-file workspace with about 180,710 source lines and 26.3 MB before dependencies. There is no root Dockerfile and no tests directory in our scan. The 2.2 GB install and nearly 15-minute suite belong to monorepo development, not the runtime cost of one published adapter.

TanStack Query owns remote state, not the request protocol

TanStack Query sits between UI components and promise-returning data functions. It tracks whether a query is loading, fresh, stale, failed, paused, or being refreshed. It also coordinates retries, cancellation, invalidation, pagination, mutations, and background updates. The application still chooses fetch, GraphQL, an SDK, or any other transport. That boundary lets one cache model work across very different APIs.

The same boundary causes common misuse. A query library cannot decide whether a response may be cached for 30 seconds, whether an error deserves retrying, or which mutation invalidates which list. Teams encode those decisions in query keys and options. If those keys are inconsistent, two screens that appear to show the same record can occupy separate cache entries and update at different times.

What happened when we ran it

Our sandbox installed 2,840 pnpm packages in 58 seconds and consumed 2,198 MB on disk. The monorepo build then passed in 9 seconds. Vitest completed in 897 seconds with 1,736 passed and 0 failed of 1,736. We tested commit 96f2da6 in an unprivileged container with 3 CPUs, 8 GB of RAM, and Node 22.

The checkout contained 2,333 files, about 180,710 lines of source, and occupied 26.3 MB before installation. Our scan found 4 CI workflow files, workspace configuration, no Dockerfile, and no tests directory. The successful 1,736-test command demonstrates that tests live within the packages or source layout rather than in one root folder.

An 897-second suite is a contributor cost, while the 9-second build is quick once dependencies exist. The 2,198 MB installation is the larger operational warning for CI caching and short-lived development containers. Consumers installing @tanstack/react-query or another adapter do not receive this entire workspace, so the lab footprint must not be mistaken for browser bundle size. We measured repository development, not shipped JavaScript weight.

Seven UI families share one query core

The release published August 26 lists packages for React, Vue, Solid, Svelte, Angular, Preact, and Lit, plus persistence, developer tools, storage persisters, and the framework-neutral query core. That range is valuable in an organization with several frontends. Shared concepts and cache rules can travel between teams even when hooks, providers, and reactivity differ.

Adapters do not behave identically because their frameworks do not. The same day's activity included Solid hydration changes, Preact error-boundary handling, and type-only exports across multiple packages. The latest release fixed React Query's handling of falsy errors at an error boundary. A team should test the adapter and rendering mode it deploys, particularly server rendering, hydration, Suspense, and error boundaries. Core success does not erase framework-specific edges.

Cache defaults are product behavior

TanStack Query can refetch when a component mounts, the window regains focus, or connectivity returns, depending on configuration and query state. Retries and garbage collection also affect what users see. These defaults are sensible for many dashboards, but surprising network traffic or a briefly old screen often comes from an unstated freshness policy rather than a broken fetch call.

Write the policy beside each domain, not as scattered component overrides. Prices, permissions, feature flags, and an immutable help article have different tolerances. Mutations need an explicit decision between invalidating and refetching, updating cached data directly, or applying an optimistic result with rollback. The library supplies each mechanism; it cannot determine which consistency promise your application owes its users.

Protocol agnosticism trades schema knowledge for flexibility

Apollo Client understands GraphQL identities and can normalize entities across query results. TanStack Query generally caches by query key and result. That is simpler for REST endpoints, custom SDKs, and mixed backends, but it does not automatically merge one changed entity into every cached response containing it. Invalidation or deliberate cache updates are part of the application layer.

For a small page, this may be more machinery than the problem needs. A server-rendered route that fetches once and never mutates can often use the framework's data primitive directly. TanStack Query earns its place when users stay on the page long enough for stale data, retries, concurrent viewers, pagination, offline transitions, or optimistic mutations to become visible product concerns.

Release 5.102.6 shows active adapter maintenance

The latest GitHub release was generated on August 26, 2026 and included @tanstack/react-query 5.102.6 alongside many coordinated packages. GitHub recorded another push on August 27. The repository had 50,210 stars and 126 combined open issues and pull requests when fetched. MIT licensing keeps adoption uncomplicated, though each application's API and data obligations remain its own.

The clean 1,736-test run supports using TanStack Query in serious applications. The decision should rest on data behavior, not popularity. Adopt it when remote-state rules are already leaking into components and request helpers. Define query keys, freshness, retries, mutation effects, and SSR behavior before rollout, then keep the 2.2 GB contributor footprint out of ordinary application images.

Alternatives

ProjectWhat it isPick it when
SWRA React hook library for remote data caching and revalidation.pick this instead when the app is React-only and a smaller remote-data API covers the requirement.
Redux ToolkitRedux's official toolkit, including RTK Query for API data fetching and caching.pick this instead when Redux already owns application state and one integrated data layer is preferable.
Apollo ClientA GraphQL client with normalized caching, local state, and framework integrations.pick this instead when the API is GraphQL and schema-aware normalized caching matters.

What people are saying

  1. [lobsters] Solving the 1+N query problem
  2. [velocity-scout] TanStack/query
  3. [lobsters] designing a query system

Sources

  1. TanStack Query repository and README
  2. TanStack Query documentation
  3. August 26, 2026 release
  4. React falsy error boundary fix
  5. Solid hydration fix

More web reviews

one-ip · page-mascot · table · yeti · react-starter-kit · leptos · the whole board →