Plugin
plugins: [pluginVueQuery()]Officialv5.3.2kubb >=5.8.0node >=22
Vue Query
@kubb/plugin-vue-query
Generates TanStack Query composables for Vue from your OpenAPI spec, so every read and write is a typed useQuery, useInfiniteQuery, or useMutation.
kubb add plugin-vue-query
vue-querytanstack-queryvuecomposablesdata-fetchingcodegenopenapi
- Downloads36.3K/ monthnpm, last 30 days
- GitHub stars8kubb-labs/plugins
- Unpacked size481.1kBv5.3.2 on npm
- Latest release45m agov5.3.2 · Oct 13, 2026
Generates TanStack Query helpers for Vue from your OpenAPI spec. By default you get queryOptions factories with their query and mutation keys. Set hooks: true to also get useQuery, useInfiniteQuery, and useMutation composables with reactive parameters.
The plugin ships no HTTP client. Each helper calls a function generated by a client plugin.
Installation
bun add -d @kubb/plugin-vue-querypnpm add -D @kubb/plugin-vue-querynpm install --save-dev @kubb/plugin-vue-queryyarn add -D @kubb/plugin-vue-queryOr run kubb add plugin-vue-query to install the version the Kubb registry pins and add pluginVueQuery() to kubb.config.ts.
Setup
- Add
@kubb/plugin-tsand a client plugin:@kubb/plugin-fetchor@kubb/plugin-axios. - Install
@tanstack/vue-queryv5 or higher in the app that uses the generated code. - Configure validation on the client plugin, not here.
Options worth knowing
clientpicksfetchoraxioswhen both client plugins are registered. A single client is detected automatically.hooksadds theuse*composables on top of the option factories.infiniteadds infinite queries for pagination. Setinfinite.queryParamto the query parameter that holds the page cursor.queryandmutationset which HTTP methods become queries (GET) and mutations (POST,PUT,PATCH,DELETE), and where the TanStack Query runtime is imported from. Set either tofalseto skip it.
Dependencies
No extension dependencies.