Skip to content

Migration: @kubb/plugin-vue-query

Part of the v4 → v5 migration guide. For the full option reference, see @kubb/plugin-vue-query.

resolver.name replaces transformers.name. The v4 transformers object held only name, so that is the whole rename. To rewrite generated nodes before printing, use the new macros option. The generators option is gone.

client is a selector, not an object

In v4 client was an object that carried the whole client config (dataReturnType, clientType, baseURL, bundle, importPath). In v5 it is a string that names a registered client plugin, and the composables call that plugin instead of emitting their own. See Query and MCP plugins select a client for the shared rules, then register @kubb/plugin-axios or @kubb/plugin-fetch and point client at it.

typescript
import { defineConfig } from '@kubb/core'
import { pluginVueQuery } from '@kubb/plugin-vue-query'

export default defineConfig({
  plugins: [
    pluginVueQuery({
      client: { client: 'axios', dataReturnType: 'data', baseURL: 'https://api.example.com' },
    }),
  ],
})
typescript
import { defineConfig } from 'kubb/config'
import { pluginTs } from '@kubb/plugin-ts'
import { pluginAxios } from '@kubb/plugin-axios'
import { pluginVueQuery } from '@kubb/plugin-vue-query'

export default defineConfig({
  plugins: [
    pluginTs(),
    pluginAxios({ baseURL: 'https://api.example.com' }),
    pluginVueQuery({ client: 'axios' }),
  ],
})

Removed: parser

As on React Query, the parser option is gone; set validator: 'zod' on the client plugin (pluginAxios/pluginFetch) instead.

Removed: paramsType, pathParamsType, paramsCasing

Same grouped-options change as React Query: each composable takes one { path, query, body, headers } object (property names from the @kubb/plugin-ts *Options type) instead of positional params. Vue Query wraps each group in MaybeRefOrGetter, so refs and getters resolve.

hooks defaults to false

As on React Query, the hooks default changed from true to false, so existing configs that relied on generated composables must now opt in with hooks: true. See hooks for exactly which composables each setting emits.

Generated output

The generated output changes match React Query. The *MutationKey type alias is gone, TData narrows to 2xx responses, required params are enforced in the type, and the auto enabled guard is dropped. The client call still unwraps each grouped option with toValue() so refs and getters resolve. See Generated output: @kubb/plugin-react-query.