Officialv5.3.1MITkubb >=5.0.0node >=22
@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.
vue-querytanstack-queryvuecomposablesdata-fetchingcodegenopenapi
- Downloads
- 36.3K/ mo
- Stars
- 8
- Bundle size
- 461.9 kB
- Updated
- 2h ago
Generate TanStack Query helpers from OpenAPI.
- Option factories and cache keys by default.
- Vue composables with reactive parameters when
hooks: true.
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.
Dependencies
- Add
pluginTsand an Axios or Fetch client plugin. - Generated output requires
@tanstack/vue-queryv5 or higher. - Configure validation on the client plugin.
Example
kubb.config.ts
import { defineConfig } from 'kubb/config'
import { pluginTs } from '@kubb/plugin-ts'
import { pluginFetch } from '@kubb/plugin-fetch'
import { pluginVueQuery } from '@kubb/plugin-vue-query'
export default defineConfig({
input: './petStore.yaml',
output: { path: './src/gen' },
plugins: [
pluginTs(),
pluginFetch(),
pluginVueQuery({ hooks: true }),
],
})