query README

The project's README from github.com/TanStack/query. As one markdown file: README.md.

TanStack Query

semantic-release Best of JS Follow @TanStack

Become a Sponsor!

TanStack Query

An async state management library built to simplify fetching, caching, synchronizing, and updating server state.

Read the docs →

Get Involved

Partners

CodeRabbit Cloudflare
Query & you?

We're looking for TanStack Query Partners to join our mission! Partner with us to push the boundaries of TanStack Query and build amazing things together.

LET'S CHAT

Explore the TanStack Ecosystem

… and more at TanStack.com »

query (TanStack/query)

Searching Database…

50.4K ·GitHub
What is this?TanStack Query is an async state management library that simplifies fetching, caching, synchronizing, and updating server state in web apps.
Is it a framework or a library?It's a library (a set of hooks/composables), not a framework — you drop it into an existing React, Vue, Svelte, or Solid app.
How do I add it to a project?Install the package for your framework (e.g. @tanstack/react-query) via your package manager, wrap your app in a QueryClientProvider, and start calling useQuery/useMutation hooks.
Which frontend frameworks are supported?React Query, Solid Query, Svelte Query, and Vue Query — it's written in TypeScript and works as JS or TS.
Does it handle the fetching logic itself?No, it's protocol-agnostic: you bring your own fetch/GraphQL/promise-based function and TanStack Query manages the caching, refetching and lifecycle around it.
Does it work with server-side rendering?Yes, it supports React Suspense and is designed to work with prefetching patterns used in SSR setups.
What is stale-while-revalidate and does TanStack Query use it?Yes, it's a caching pattern where stale data is shown immediately while a background refetch updates it, which is central to how TanStack Query's cache invalidation works.
Is there devtools support?The TanStack ecosystem includes a unified devtools panel that can be used alongside Query to inspect cache state.
Can I use it for pagination and infinite scroll?Yes, pagination and infinite scroll are built-in supported patterns alongside prefetching and cancellation.
What other TanStack tools pair with Query?The ecosystem includes TanStack Router for type-safe routing, TanStack Form for form state, TanStack Table for datagrids, and TanStack Start for full-stack SSR.
What are similar projects?swr, table, shaders, mitosis, ai, rxdb, pretty-ts-errors, astro
Which topics is it in?fetch, solid, cache, rest, data, realtime, svelte, hooks, graphql, async, vue, react
Creator
TanStack
Size
129 MB
Stars
50.4K
Age
7y
Commits · 90 Days