A React Hooks library for data fetching that returns cached data first, then revalidates it in the background.
TanStack/query
Async state management and data fetching library for web apps, with bindings for React, Vue, Svelte and Solid.
- Stars
- 50,456
- Forks
- 4,222
- Open issues
- 151
- Last commit
- 2 hours ago
What is it?
TanStack Query is an async state management library that handles fetching, caching, synchronizing and updating server state in web applications. It is protocol-agnostic, so it works with REST, GraphQL, or any promise-based data source.
The library covers common data-fetching needs such as caching, background refetching, pagination and infinite scroll, mutations, dependent queries, prefetching and request cancellation. It also supports React Suspense. The core logic lives in a framework-agnostic package, with official adapters for React Query, Vue Query, Svelte Query and Solid Query.
The project is written in TypeScript and is part of the wider TanStack ecosystem, which includes Router, Table, Form and Virtual.
Key features
- 01Caching with stale-while-revalidate style background refetching
- 02Pagination, infinite scroll and dependent queries
- 03Mutations with cache updates
- 04Prefetching and request cancellation
- 05Official bindings for React, Vue, Svelte and Solid
Use cases
- Building React or Vue front ends that load data from REST or GraphQL APIs
- Replacing hand-written loading, error and caching logic in client apps
- Implementing infinite-scroll lists or paginated tables backed by remote data
Quick start
- 1
Read the docs and pick your framework binding
- 2
Follow the contributing setup instructions in CONTRIBUTING.md
Topics
FAQ
- What is query?
- Async state management and data fetching library for web apps, with bindings for React, Vue, Svelte and Solid. TanStack Query is an async state management library that handles fetching, caching, synchronizing and updating server state in web applications. It is protocol-agnostic, so it works with REST, GraphQL, or any promise-based data source.
- Is query free to use? What license does it have?
- query is open source under the MIT license. Check the license terms before using it in commercial products.
- Is query still maintained?
- Actively maintained. The last commit to query was on Oct 21, 2026.
- What can I use query for?
- Building React or Vue front ends that load data from REST or GraphQL APIs Replacing hand-written loading, error and caching logic in client apps Implementing infinite-scroll lists or paginated tables backed by remote data
- How do I install query?
- Read the docs and pick your framework binding Follow the contributing setup instructions in CONTRIBUTING.md
- Where can I get query?
- The source code and installation instructions are on GitHub: https://github.com/TanStack/query
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Headless TypeScript/JavaScript table library for building datagrids with full control over markup and styling, across React, Vue, Solid, Svelte and more.
A small, hook-based state-management library for React with no providers required.
A headless, framework-agnostic rich text editor built on ProseMirror, extensible through a large set of extensions.
Open source React and Svelte libraries for building interactive node-based UIs such as flowcharts, graphs and workflow editors.
An open multi-platform, multi-framework solution for building one app that runs on WeChat/Alipay/other mini programs, H5 web, and React Native using React or Vue.