# TanStack Query

[BASE product page](<https://base.akulich.dev/en/library/tanstack-query/>) · [Resource](<https://github.com/tanstack/query>)

ID: tanstack\-query · Language: en
Schema version: 1 · Data version: cbbe7123b47a5ae80983

This is editorial data. An unknown field neither confirms nor rules out a capability.
dataVersion is a dataset fingerprint, not evidence of a recent fact check.

Manages asynchronous server data in the interface: caches requests, refreshes data, and handles loading and error states\.

## Type

Web framework / library

## Entry type

library

## Separate catalog

No

## [Access conditions](<https://base.akulich.dev/en/library/tanstack-query/#resource-access>)

free

## [What you can use for free](<https://base.akulich.dev/en/library/tanstack-query/#resource-access>)

Code and local use under MIT\.

## [Paid features and costs](<https://base.akulich.dev/en/library/tanstack-query/#resource-access>)

Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Access and limitations](<https://base.akulich.dev/en/library/tanstack-query/#resource-access>)

Code and local use under MIT\. Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Use cases](<https://base.akulich.dev/en/library/tanstack-query/#resource-tasks>)

- Coordinate server data and interface states
- Connect loading/error UI and cache updates after data changes

## Category IDs

- frontend

## Subcategory IDs

- frontend\.utilities
- frontend\.state

## Tags

- TanStack Query
- web
- Development

## Also known as

- tanstack/query
- tanstack\-query
- tanstack\-query\-library

## [Selection purpose](<https://base.akulich.dev/en/library/tanstack-query/#resource-selection>)

Coordinate server data and interface states

## [Choose this when](<https://base.akulich.dev/en/library/tanstack-query/#resource-selection>)

- Coordinate server data and interface states
- Connect loading/error UI and cache updates after data changes

## [Consider alternatives when](<https://base.akulich.dev/en/library/tanstack-query/#resource-selection>)

- When choosing for this topic, compare TanStack Query with SWR\. A candidate to compare under the topic: State and client data, Web interface tools\. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together\.
- When choosing for this topic, compare TanStack Query with Immer\. A candidate to compare under the topic: State and client data\. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together\.

## [Requirements](<https://base.akulich.dev/en/library/tanstack-query/#resource-selection>)

- Define query and mutation functions, cache keys, and loading/error displays in the application\.

## [Limitations](<https://base.akulich.dev/en/library/tanstack-query/#resource-selection>)

- Costs and limits of free use: Computing resources, self\-hosting, and external services are paid for separately if used\.
- Terms of use: MIT for the code; dependencies have separate licenses\.
- Caching does not replace server authorization\. Define update and error\-handling rules for your data source\.

## [Questions before use](<https://base.akulich.dev/en/library/tanstack-query/#resource-faq>)

### What can you use for free in TanStack Query?

Code and local use under MIT\.

### What additional costs might arise with TanStack Query?

Computing resources, self\-hosting, and external services are paid for separately if used\.

### What terms of use matter for TanStack Query?

MIT for the code; dependencies have separate licenses\.

### How do you get started with TanStack Query?

Describe the query key and data\-fetching function\. Connect loading/error UI and cache updates after data changes\. Add real data and error handling; check the production build\.

### What does TanStack Query handle when working with server data?

The library manages fetching, caching, synchronization, and updates of asynchronous state\. It supports REST, GraphQL, and other promise\-returning sources, refetching, pagination, infinite scrolling, mutations, dependent queries, prefetching, and cancellation\. This is a data\-state layer, not a ready\-made table interface\.

## Related resources selected by editors

- swr: A candidate to compare under the topic: State and client data, Web interface tools\. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together\.
- immer: A candidate to compare under the topic: State and client data\. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together\.
- jotai: A candidate to compare under the topic: State and client data\. This is an editorial connection by topic, not a confirmed alternative or a guarantee that the products work together\.

## Sources for the selection guide

- [https://github\.com/tanstack/query](<https://github.com/tanstack/query>)
- [https://raw\.githubusercontent\.com/tanstack/query/HEAD/README\.md](<https://raw.githubusercontent.com/tanstack/query/HEAD/README.md>)
- [https://raw\.githubusercontent\.com/tanstack/query/HEAD/LICENSE](<https://raw.githubusercontent.com/tanstack/query/HEAD/LICENSE>)
- [https://www\.open\-source\-tools\.com/](<https://www.open-source-tools.com/>)

## [Possible workflow](<https://base.akulich.dev/en/library/tanstack-query/#resource-scenario>)

Coordinate server data and interface states\.

A possible workflow; this is not a report of hands-on testing.

## Before you start

- Web application source code and the intended workflow\.
- The project's framework and runtime version\.

## Steps

1. Describe the query key and data\-fetching function\.
2. Connect loading/error UI and cache updates after data changes\.
3. Add real data and error handling; check the production build\.

## Check your result

- The workflow works after a page refresh and with invalid data\.
- The bundle, server rendering, and supported browsers suit the project\.

## [License](<https://base.akulich.dev/en/library/tanstack-query/#resource-license>)

MIT for the code; dependencies have separate licenses\.

## License explanations for the specified scope

### MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed\-source commercial product\. When sharing copies or substantial portions of the code, retain the license text and copyright notice\. You do not need to open\-source your entire project; the author provides no warranties\.

[License terms](<https://opensource.org/license/mit>)

## Related resource IDs

- zustand
- jotai
- valtio
- immer
- swr

## [Sources](<https://base.akulich.dev/en/library/tanstack-query/#resource-sources>)

- [Official source](<https://github.com/tanstack/query>)
- [Official source](<https://raw.githubusercontent.com/tanstack/query/HEAD/README.md>)
- [License](<https://raw.githubusercontent.com/tanstack/query/HEAD/LICENSE>)
- [Catalog / discovery source](<https://www.open-source-tools.com/>)

## Editorial review date

2026\-10\-06

## Editorial review scope

The purpose, current repository license, and separate terms for code, services, and models have been reviewed\. The product was not run, and no security audit was performed\.

Dates refer to the stated editorial review, not hands-on testing, a product update, or a recent review of all sources.
