{"id":13760289,"url":"https://github.com/DamianOsipiuk/vue-query","last_synced_at":"2025-05-10T10:32:08.635Z","repository":{"id":37447813,"uuid":"336306928","full_name":"DamianOsipiuk/vue-query","owner":"DamianOsipiuk","description":"Hooks for fetching, caching and updating asynchronous data in Vue","archived":false,"fork":false,"pushed_at":"2023-06-27T14:28:26.000Z","size":1842,"stargazers_count":1110,"open_issues_count":3,"forks_count":48,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-16T12:47:34.860Z","etag":null,"topics":["async","cache","fetch","graphql","hooks","query","rest","stale","stale-while-revalidate","vue"],"latest_commit_sha":null,"homepage":"https://vue-query.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DamianOsipiuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":"DamianOsipiuk","custom":"paypal.me/DamianOsipiuk"}},"created_at":"2021-02-05T15:13:23.000Z","updated_at":"2024-11-11T13:22:28.000Z","dependencies_parsed_at":"2024-01-05T21:09:41.511Z","dependency_job_id":"c929f792-b688-49f5-ad86-fc92c137735a","html_url":"https://github.com/DamianOsipiuk/vue-query","commit_stats":{"total_commits":215,"total_committers":15,"mean_commits":"14.333333333333334","dds":"0.11627906976744184","last_synced_commit":"2459efd169836556af19fd9a8e2a03fb558e852f"},"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianOsipiuk%2Fvue-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianOsipiuk%2Fvue-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianOsipiuk%2Fvue-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamianOsipiuk%2Fvue-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamianOsipiuk","download_url":"https://codeload.github.com/DamianOsipiuk/vue-query/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224917283,"owners_count":17391823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","cache","fetch","graphql","hooks","query","rest","stale","stale-while-revalidate","vue"],"created_at":"2024-08-03T13:01:07.039Z","updated_at":"2024-11-16T17:30:54.797Z","avatar_url":"https://github.com/DamianOsipiuk.png","language":"TypeScript","funding_links":["https://github.com/sponsors/DamianOsipiuk","paypal.me/DamianOsipiuk"],"categories":["Packages","API","TypeScript"],"sub_categories":["Runner"],"readme":"[![Vue Query logo](./media/vue-query.png)](https://damianosipiuk.github.io/vue-query/)\n\n[![npm version](https://img.shields.io/npm/v/vue-query)](https://www.npmjs.com/package/vue-query)\n[![npm license](https://img.shields.io/npm/l/vue-query)](https://github.com/DamianOsipiuk/vue-query/blob/main/LICENSE)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/vue-query)](https://bundlephobia.com/result?p=vue-query)\n[![npm](https://img.shields.io/npm/dm/vue-query)](https://www.npmjs.com/package/vue-query)\n\n[![build status](https://img.shields.io/github/workflow/status/DamianOsipiuk/vue-query/CI/main)](https://github.com/DamianOsipiuk/vue-query/actions/workflows/ci.yml?query=branch%3Amain)\n[![codecov](https://codecov.io/gh/DamianOsipiuk/vue-query/branch/main/graph/badge.svg?token=X8FK0O5CTG)](https://codecov.io/gh/DamianOsipiuk/vue-query)\n\n# :warning: Package migration :warning:\nThis package was migrated to be a part of https://github.com/TanStack/query.\n\nIf you are still on `v1` make sure to follow [migration guide](https://vue-query-next.vercel.app/#/guides/migrating-to-vue-query-2) first and then switch to `@tanstack/vue-query`.\n\nIf you are already on `v2`, just swap `vue-query` for `@tanstack/vue-query` in both of your `package.json` and `import` statements. Everything should still work as before.\n\n# Vue Query\n\nHooks for fetching, caching and updating asynchronous data in Vue.\n\nSupport for Vue 2.x via [vue-demi](https://github.com/vueuse/vue-demi)\n\nBased on [react-query](https://github.com/tannerlinsley/react-query)\n\n# Documentation\n\nVisit https://vue-query.vercel.app\n\nVisit https://vue-query-next.vercel.app for V2 documentation\n\nFor topics not covered in `vue-query docs` visit [react-query docs](https://react-query.tanstack.com/reference/useQuery) as most of the concepts and APIs are the same.\n\n# Quick Features\n\n- Transport/protocol/backend agnostic data fetching (REST, GraphQL, promises, whatever!)\n- Auto Caching + Refetching (stale-while-revalidate, Window Refocus, Polling/Realtime)\n- Parallel + Dependent Queries\n- Mutations + Reactive Query Refetching\n- Multi-layer Cache + Automatic Garbage Collection\n- Paginated + Cursor-based Queries\n- Load-More + Infinite Scroll Queries w/ Scroll Recovery\n- Request Cancellation\n- (experimental) [Suspense](https://v3.vuejs.org/guide/migration/suspense.html#introduction) + Fetch-As-You-Render Query Prefetching\n- (experimental) SSR support\n- Dedicated Devtools\n- [![npm bundle size](https://img.shields.io/bundlephobia/minzip/vue-query)](https://bundlephobia.com/result?p=vue-query) (depending on features imported)\n\n# Quick Start\n\n1. Install `vue-query`\n    ```bash\n    npm install vue-query\n    # or\n    yarn add vue-query\n    ```\n\n    \u003e If you are using Vue 2.x, make sure to also setup [@vue/composition-api](https://github.com/vuejs/composition-api)\n\n2. Initialize **Vue Query** via **VueQueryPlugin**\n\n   ```ts\n   import { createApp } from \"vue\";\n   import { VueQueryPlugin } from \"vue-query\";\n\n   import App from \"./App.vue\";\n\n   createApp(App).use(VueQueryPlugin).mount(\"#app\");\n   ```\n\n3. Use query\n\n   ```ts\n   import { defineComponent } from \"vue\";\n   import { useQuery } from \"vue-query\";\n\n   export default defineComponent({\n     name: \"MyComponent\",\n     setup() {\n       const query = useQuery(\"todos\", getTodos);\n\n       return {\n         query,\n       };\n     },\n   });\n   ```\n\n4. If you need to update options on your query dynamically, make sure to pass them as reactive variables\n\n   ```ts\n   const id = ref(1);\n   const enabled = ref(false);\n\n   const query = useQuery([\"todos\", id], () =\u003e getTodos(id), { enabled });\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamianOsipiuk%2Fvue-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDamianOsipiuk%2Fvue-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamianOsipiuk%2Fvue-query/lists"}