@tanstack/vue-query
Hooks for managing, caching and syncing asynchronous and remote data in Vue
19,223,180
50,490
| Install | |
|---|---|
npm install @tanstack/vue-query |
|
| Latest Version: | 5.105.0 |
| Vue: | 2 · 3 |
| License: | MIT |
| Last Updated: | Oct 27, 2026 |
| Links: | GitHub · npm |
Maintainer: tannerlinsley
Vue Query
Hooks for fetching, caching and updating asynchronous data in Vue.
Support for Vue 2.x via vue-demi
Documentation
Visit https://tanstack.com/query/latest/docs/vue/overview
Quick Features
- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)
- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)
- Parallel + Dependent Queries
- Mutations + Reactive Query Refetching
- Multi-layer Cache + Automatic Garbage Collection
- Paginated + Cursor-based Queries
- Load-More + Infinite Scroll Queries w/ Scroll Recovery
- Request Cancellation
- (experimental) Suspense + Fetch-As-You-Render Query Prefetching
- (experimental) SSR support
- Dedicated Devtools
(depending on features imported)
Quick Start
-
Install
vue-query$ npm i @tanstack/vue-queryor
$ pnpm add @tanstack/vue-queryor
$ yarn add @tanstack/vue-queryor
$ bun add @tanstack/vue-queryIf you are using Vue 2.6, make sure to also setup @vue/composition-api
-
Initialize Vue Query via VueQueryPlugin
import { createApp } from 'vue' import { VueQueryPlugin } from '@tanstack/vue-query' import App from './App.vue' createApp(App).use(VueQueryPlugin).mount('#app') -
Use query
import { defineComponent } from 'vue' import { useQuery } from '@tanstack/vue-query' export default defineComponent({ name: 'MyComponent', setup() { const query = useQuery({ queryKey: ['todos'], queryFn: getTodos }) return { query, } }, }) -
If you need to update options on your query dynamically, make sure to pass them as reactive variables
const id = ref(1) const enabled = ref(false) const query = useQuery({ queryKey: ['todos', id], queryFn: () => getTodos(id), enabled, })
Related Packages
@tanstack/vue-query-devtools
Developer tools to interact with and visualize the TanStack/vue-query cache
3,832,492
50,490
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 5.105.0 | ^2.6.0 || | MIT | |
| 5.104.5 | ^2.6.0 || | MIT | |
| 5.104.4 | ^2.6.0 || | MIT | |
| 5.104.3 | ^2.6.0 || | MIT | |
| 5.104.2 | ^2.6.0 || | MIT | |
| 5.104.1 | ^2.6.0 || | MIT | |
| 5.104.0 | ^2.6.0 || | MIT | |
| 5.103.3 | ^2.6.0 || | MIT | |
| 5.103.2 | ^2.6.0 || | MIT | |
| 5.103.1 | ^2.6.0 || | MIT | |
| 5.103.0 | ^2.6.0 || | MIT | |
| 5.102.8 | ^2.6.0 || | MIT | |
| 5.102.7 | ^2.6.0 || | MIT | |
| 5.102.6 | ^2.6.0 || | MIT | |
| 5.102.5 | ^2.6.0 || | MIT | |
| 5.102.4 | ^2.6.0 || | MIT | |
| 5.102.3 | ^2.6.0 || | MIT | |
| 5.102.2 | ^2.6.0 || | MIT | |
| 5.102.1 | ^2.6.0 || | MIT | |
| 5.102.0 | ^2.6.0 || | MIT | |
| 5.101.4 | ^2.6.0 || | MIT | |
| 5.101.3 | ^2.6.0 || | MIT | |
| 5.101.2 | ^2.6.0 || | MIT | |
| 5.101.1 | ^2.6.0 || | MIT | |
| 5.101.0 | ^2.6.0 || | MIT | |
| 5.100.14 | ^2.6.0 || | MIT | |
| 5.100.13 | ^2.6.0 || | MIT | |
| 5.100.12 | ^2.6.0 || | MIT | |
| 5.100.11 | ^2.6.0 || | MIT | |
| 5.100.10 | ^2.6.0 || | MIT |
Showing the latest 30 of 404. See every release on npm
Pre-releases (85)
| Version | Released | Vue | License |
|---|---|---|---|
| 5.0.0-rc.16 | ^2.6.0 || | MIT | |
| 5.0.0-rc.15 | ^2.6.0 || | MIT | |
| 5.0.0-rc.12 | ^2.6.0 || | MIT | |
| 5.0.0-rc.11 | ^2.6.0 || | MIT | |
| 5.0.0-rc.6 | ^2.6.0 || | MIT | |
| 5.0.0-rc.5 | ^2.6.0 || | MIT | |
| 5.0.0-rc.4 | ^2.6.0 || | MIT | |
| 5.0.0-rc.3 | ^2.6.0 || | MIT | |
| 5.0.0-rc.1 | ^2.6.0 || | MIT | |
| 5.0.0-beta.35 | ^2.6.0 || | MIT | |
| 5.0.0-beta.31 | ^2.6.0 || | MIT | |
| 5.0.0-beta.29 | ^2.6.0 || | MIT | |
| 5.0.0-beta.28 | ^2.6.0 || | MIT | |
| 5.0.0-beta.27 | ^2.6.0 || | MIT | |
| 5.0.0-beta.24 | ^2.6.0 || | MIT | |
| 5.0.0-beta.23 | ^2.6.0 || | MIT | |
| 5.0.0-beta.22 | ^2.6.0 || | MIT | |
| 5.0.0-beta.20 | ^2.5.0 || | MIT | |
| 5.0.0-beta.18 | ^2.5.0 || | MIT | |
| 5.0.0-beta.17 | ^2.5.0 || | MIT | |
| 5.0.0-beta.15 | ^2.5.0 || | MIT | |
| 5.0.0-beta.14 | ^2.5.0 || | MIT | |
| 5.0.0-beta.12 | ^2.5.0 || | MIT | |
| 5.0.0-beta.11 | ^2.5.0 || | MIT | |
| 5.0.0-beta.9 | ^2.5.0 || | MIT | |
| 5.0.0-beta.6 | ^2.5.0 || | MIT | |
| 5.0.0-beta.5 | ^2.5.0 || | MIT | |
| 5.0.0-beta.0 | ^2.5.0 || | MIT | |
| 5.0.0-alpha.91 | ^2.5.0 || | MIT | |
| 5.0.0-alpha.90 | ^2.5.0 || | MIT |
Showing the latest 30 of 85. See every release on npm