{"id":13880845,"url":"https://github.com/logaretm/villus","last_synced_at":"2025-05-14T05:12:17.425Z","repository":{"id":36687179,"uuid":"229629481","full_name":"logaretm/villus","owner":"logaretm","description":"🏎 A tiny and fast GraphQL client for Vue.js","archived":false,"fork":false,"pushed_at":"2025-01-20T17:17:40.000Z","size":5764,"stargazers_count":814,"open_issues_count":17,"forks_count":33,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-11T06:47:08.869Z","etag":null,"topics":["api","apollo","composition-api","graphql","graphql-api","graphql-apis","graphql-client","hacktoberfest","vue"],"latest_commit_sha":null,"homepage":"https://villus.dev","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/logaretm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"logaretm","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-12-22T20:52:31.000Z","updated_at":"2025-04-30T05:23:29.000Z","dependencies_parsed_at":"2024-05-18T14:32:01.642Z","dependency_job_id":"2d2673e0-25d8-47f4-8f5d-7d43697bd860","html_url":"https://github.com/logaretm/villus","commit_stats":{"total_commits":630,"total_committers":24,"mean_commits":26.25,"dds":0.080952380952381,"last_synced_commit":"f2b6c7ba699858e737df85d3438b24dede6dc924"},"previous_names":[],"tags_count":101,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logaretm%2Fvillus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logaretm%2Fvillus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logaretm%2Fvillus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logaretm%2Fvillus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logaretm","download_url":"https://codeload.github.com/logaretm/villus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"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":["api","apollo","composition-api","graphql","graphql-api","graphql-apis","graphql-client","hacktoberfest","vue"],"created_at":"2024-08-06T08:03:32.441Z","updated_at":"2025-05-14T05:12:12.406Z","avatar_url":"https://github.com/logaretm.png","language":"TypeScript","funding_links":["https://github.com/sponsors/logaretm"],"categories":["TypeScript"],"sub_categories":[],"readme":"# villus\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/logaretm/villus/main/logo.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/villus\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/villus.svg?label=\u0026color=05bda8\"\u003e\n  \u003c/a\u003e\n  \u003ca target=\"_blank\" href=\"https://npm-stat.com/charts.html?package=villus\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/villus.svg?color=05bd6d\u0026label=\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://villus.dev/\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/-docs%20and%20demos-009f53\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/sponsors/logaretm\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/-%E2%99%A5%20Sponsors-ec5cc6\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch6 align=\"center\"\u003eVillus is a finger-like structures in the small intestine. They help to absorb digested food.\u003c/h6\u003e\n\n\u003cp align=\"center\"\u003e\nA small and fast GraphQL client for **Vue.js**\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/sponsors/logaretm\"\u003e\n    \u003cimg src='https://sponsors.logaretm.com/sponsors.svg'\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\nYou can also help this this project and my other projects by donating one time or by sponsoring.\n\n## Features\n\n- 📦 **Minimal:** Its all you need to query GQL APIs\n- 🦐 **Tiny:** Very small footprint\n- 🗄 **Caching:** Simple and convenient query caching by default\n- 👕 **TypeScript:** Written in Typescript and Supports GraphQL TS tooling\n- 🖇 **Composable:** Built for the Composition API\n- ⚡️ **Suspense:** Supports the `\u003cSuspense\u003e` API\n- 🔌 **Plugins:** Use existing plugins and create custom ones\n\n## Why use this\n\nGraphQL is just a simple HTTP request. This library is meant to be a tiny client without all the bells and whistles attached to Apollo and its ecosystem which subsequently means it is faster across the board due to it's smaller bundle size and reduced overhead. `villus` offers simple strategies to cache and batch, dedup your GraphQL requests.\n\n`villus` also supports file uploads and subscriptions without compromising bundle size through plugins.\n\nIf you are looking for a more full-featured client use [vue-apollo](https://github.com/vuejs/vue-apollo), it has everything you need.\n\nYou can read more about it in the [announcement post](https://logaretm.com/blog/2020-01-11-announcing-villus/).\n\n## Documentation\n\nYou can find the [documentation here](https://villus.dev/)\n\n## Quick Start\n\nFirst install `villus`:\n\n```bash\nyarn add villus graphql\n\n# or npm\n\nnpm install villus graphql --save\n```\n\nOr because villus is so simple, you can use it via CDN:\n\n```html\n\u003c!-- Import Vue 3 --\u003e\n\u003cscript src=\"https://unpkg.com/vue@3.0.2/dist/vue.global.js\"\u003e\u003c/script\u003e\n\u003c!-- Villus --\u003e\n\u003cscript src=\"https://unpkg.com/villus@latest/dist/villus.min.js\"\u003e\u003c/script\u003e\n```\n\n### Usage\n\nConfigure the GraphQL client for your root component:\n\n```vue\n\u003cscript setup\u003e\nimport { useClient } from 'villus';\n\nuseClient({\n  url: 'http://localhost:3002/graphql',\n});\n\u003c/script\u003e\n```\n\nThen you can use `useQuery` in any child component:\n\n```vue\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cdiv v-if=\"data\"\u003e\n      \u003cpre\u003e{{ data }}\u003c/pre\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript setup\u003e\nimport { useQuery } from 'villus';\n\nconst AllPosts = `\n  query AllPosts {\n    posts {\n      title\n    }\n  }\n`;\n\nconst { data } = useQuery({\n  query: AllPosts,\n});\n\u003c/script\u003e\n```\n\n`villus` makes frequent tasks such as re-fetching, caching, deduplication, mutations, and subscriptions a breeze. It has even built-in `Suspense` support with Vue 3! Consult the [documentation](https://villus.dev) for more use-cases and examples.\n\n## Compatibility\n\nThis library relies on the `fetch` web API to run queries, you can use [`unfetch`](https://github.com/developit/unfetch) (client-side) or [`node-fetch`](https://www.npmjs.com/package/node-fetch) (server-side) to use as a polyfill.\n\nThis library is compatible with Vue 3.0+ or 2.7+\n\n## Examples\n\nLive examples can be found [here](https://villus.dev/examples/basic-query)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogaretm%2Fvillus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogaretm%2Fvillus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogaretm%2Fvillus/lists"}