@kubb/plugin-vue-query 5.3.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ # Call operations
2
+
3
+ `@kubb/plugin-vue-query` can generate a typed TanStack Query composable for each operation. `GET` operations get query composables such as `useGetPetById`, and `POST`, `PUT`, `PATCH`, and `DELETE` operations get mutation composables such as `useUpdatePetWithForm`. Each composable calls the client function from `@kubb/plugin-fetch` or `@kubb/plugin-axios`.
4
+
5
+ > [!IMPORTANT]
6
+ > By default the plugin emits only the factory helpers (`queryOptions`, `queryKey`, `mutationKey`). Set [`hooks: true`](https://kubb.dev/extensions/kubb-labs/plugin-vue-query/options#hooks) in the plugin options to also generate the `use*` composables shown below.
7
+
8
+ ## Queries
9
+
10
+ A query composable takes grouped request parameters as its first argument. Parameters accept a value, ref, or getter. See [reactive parameters](#refetch-when-parameters-change).
11
+
12
+ ```typescript [usage.ts]
13
+ import { useGetPetById } from './gen/hooks/useGetPetById'
14
+
15
+ const { data, error, isLoading } = useGetPetById({ path: { petId: 1n } })
16
+ ```
17
+
18
+ The second argument has two optional groups. `query` takes any TanStack Query option, and `query.client` sets the `QueryClient` to use. The top-level `client` takes request config for this call, such as `baseURL`:
19
+
20
+ ```typescript
21
+ import { useFindPetsByTags } from './gen/hooks/useFindPetsByTags'
22
+
23
+ useFindPetsByTags(
24
+ { query: { tags: ['dog'] } },
25
+ {
26
+ query: { staleTime: 60_000 },
27
+ client: { baseURL: 'https://api.example.com/v1' },
28
+ },
29
+ )
30
+ ```
31
+
32
+ ## Factories
33
+
34
+ Every query operation also exports a `queryOptions` factory and a `queryKey` helper for prefetching and invalidation. The key is `[{ url }, query]`, built from the operation path and its query params:
35
+
36
+ ```typescript
37
+ import { useQueryClient } from '@tanstack/vue-query'
38
+ import { findPetsByTagsQueryKey, findPetsByTagsQueryOptions } from './gen/hooks/useFindPetsByTags'
39
+
40
+ const queryClient = useQueryClient()
41
+
42
+ await queryClient.prefetchQuery(findPetsByTagsQueryOptions({ query: { tags: ['dog'] } }))
43
+ queryClient.invalidateQueries({ queryKey: findPetsByTagsQueryKey({ query: { tags: ['dog'] } }) })
44
+ ```
45
+
46
+ Mutations export a `mutationKey` helper next to the composable.
47
+
48
+ ## Mutations
49
+
50
+ A mutation composable takes only an options object. The grouped request config is the mutation variable, so you pass it to `mutate` or `mutateAsync`:
51
+
52
+ ```typescript
53
+ import { useQueryClient } from '@tanstack/vue-query'
54
+ import { useUpdatePetWithForm } from './gen/hooks/useUpdatePetWithForm'
55
+
56
+ const queryClient = useQueryClient()
57
+
58
+ const { mutate } = useUpdatePetWithForm({
59
+ mutation: { onSuccess: () => queryClient.invalidateQueries() },
60
+ })
61
+
62
+ mutate({ path: { petId: 1n }, query: { name: 'Fluffy' } })
63
+ ```
64
+
65
+ ## Errors and transport
66
+
67
+ Each generated composable calls the client function with `throwOnError: true`. A failed request sets TanStack Query's `error`, typed from the error responses in the spec. Set the base URL, authentication, interceptors, serialization, and validation on the client plugin. See the [plugin-fetch](https://kubb.dev/extensions/kubb-labs/plugin-fetch) or [plugin-axios](https://kubb.dev/extensions/kubb-labs/plugin-axios) guide.
68
+
69
+ ## Customize cache keys
70
+
71
+ Set `queryKey` on the plugin to change generated keys. String entries are emitted as source code, so use `JSON.stringify` for a string literal.
72
+
73
+ ```typescript [kubb.config.ts]
74
+ import { pluginVueQuery } from '@kubb/plugin-vue-query'
75
+
76
+ pluginVueQuery({
77
+ queryKey: ({ node }) => [JSON.stringify(node.operationId)],
78
+ })
79
+ ```
80
+
81
+ > [!WARNING]
82
+ > This `queryKey` gives every call the same key, such as `['getUserByName']`. If path or query values select different data, add them to the key.
83
+
84
+ ## Load more pages
85
+
86
+ Configure `infinite` with a query parameter declared by the operation, its initial value, and the response path for the next cursor. Infinite output needs `hooks: true`, and only operations that declare the `queryParam` receive it.
87
+
88
+ ::code-group
89
+
90
+ ```typescript [kubb.config.ts]
91
+ import { pluginVueQuery } from '@kubb/plugin-vue-query'
92
+
93
+ pluginVueQuery({
94
+ hooks: true,
95
+ infinite: {
96
+ queryParam: 'page',
97
+ initialPageParam: 0,
98
+ nextParam: 'pagination.next.cursor',
99
+ },
100
+ })
101
+ ```
102
+
103
+ ```typescript [usage.ts]
104
+ import { useInfiniteQuery } from '@tanstack/vue-query'
105
+ import { findPetsByTagsInfiniteQueryOptions } from './gen/hooks/useFindPetsByTagsInfinite'
106
+
107
+ const { data, fetchNextPage, hasNextPage } = useInfiniteQuery(
108
+ findPetsByTagsInfiniteQueryOptions({ query: () => ({ tags: ['dog'] }) }),
109
+ )
110
+ ```
111
+
112
+ ::
113
+
114
+ `nextParam` takes dot notation or an array of keys. Change it to match your API's response. Without `getNextPageParam`, `nextParam` or `cursorParam`, the generated options increment the page number until a page returns an empty array.
115
+
116
+ ## Refetch when parameters change
117
+
118
+ Enable `hooks: true`, then pass a ref or getter to a generated composable. Parameters accept `MaybeRefOrGetter`. A getter tracks its reactive dependencies.
119
+
120
+ ```typescript [usage.ts]
121
+ import { ref } from 'vue'
122
+ import { useFindPetsByTags } from './gen/hooks/useFindPetsByTags'
123
+
124
+ const tags = ref(['dog'])
125
+ const { data, error, isLoading } = useFindPetsByTags({
126
+ query: () => ({ tags: tags.value }),
127
+ })
128
+
129
+ tags.value = ['cat']
130
+ ```
131
+
132
+ Changing `tags.value` updates the query key and fetches the corresponding resource.
@@ -0,0 +1,271 @@
1
+ # Options
2
+
3
+ Pass these options to `pluginVueQuery()`. Shared options link to [Shared plugin options](https://kubb.dev/docs/5.x/reference/plugin-options) for details.
4
+
5
+ ## Options overview
6
+
7
+ | Option | Purpose | Default |
8
+ | ------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
9
+ | [`output`](https://kubb.dev/docs/5.x/reference/plugin-options#output) | Where files are written: `path`, `mode`, `barrel`, `banner`, `footer`. | `{ path: 'hooks', barrel: { type: 'named' } }` |
10
+ | [`group`](https://kubb.dev/docs/5.x/reference/plugin-options#group) | Split output by tag or path: `type`, `name`. | None |
11
+ | [`client`](#client) | Which registered client plugin the composables call. | Auto-detected |
12
+ | [`infinite`](#infinite) | Add `useInfiniteQuery` composables for paginated reads. | `false` |
13
+ | [`query`](#query) | Configure or disable query composables. | `{ methods: ['GET'], importPath: '@tanstack/vue-query' }` |
14
+ | [`queryKey`](#querykey) | Build the `queryKey` for each query composable. | Built-in `queryKeyTransformer` |
15
+ | [`mutation`](#mutation) | Configure or disable mutation composables. | `{ methods: ['POST', 'PUT', 'PATCH', 'DELETE'], importPath: '@tanstack/vue-query' }` |
16
+ | [`mutationKey`](#mutationkey) | Build the `mutationKey` for each mutation composable. | Built-in `mutationKeyTransformer` |
17
+ | [`hooks`](#hooks) | Emit `use*` composables on top of the factory helpers. | `false` |
18
+ | [`include`](https://kubb.dev/docs/5.x/reference/plugin-options#include) | Keep only operations that match. | None |
19
+ | [`exclude`](https://kubb.dev/docs/5.x/reference/plugin-options#exclude) | Skip operations that match. | `[]` |
20
+ | [`override`](https://kubb.dev/docs/5.x/reference/plugin-options#override) | Apply different options per pattern. | `[]` |
21
+ | [`resolver`](#resolver) | Customize generated names and file paths. | `resolverVueQuery` |
22
+ | [`macros`](https://kubb.dev/docs/5.x/reference/plugin-options#macros) | Rewrite AST nodes before printing. | `[]` |
23
+
24
+ ## Option details
25
+
26
+ ### client
27
+
28
+ Selects which registered client plugin the composables call. A single registered client is auto-detected. Set `client` when several are registered.
29
+
30
+ | | |
31
+ | -------- | -------------------- |
32
+ | Type | `'axios' \| 'fetch'` |
33
+ | Required | `false` |
34
+
35
+ ::field-group
36
+
37
+ :::field{name="'fetch'"}
38
+ Calls the operations generated by [`@kubb/plugin-fetch`](https://kubb.dev/extensions/kubb-labs/plugin-fetch).
39
+ :::
40
+
41
+ :::field{name="'axios'"}
42
+ Calls the operations generated by [`@kubb/plugin-axios`](https://kubb.dev/extensions/kubb-labs/plugin-axios).
43
+ :::
44
+
45
+ ::
46
+
47
+ ### infinite
48
+
49
+ Adds `infiniteQueryOptions` and `useInfiniteQuery` for operations that declare the query parameter named in `infinite.queryParam`. Needs [`hooks: true`](#hooks).
50
+
51
+ | | |
52
+ | -------- | ---------------------------- |
53
+ | Type | `Partial<Infinite> \| false` |
54
+ | Required | `false` |
55
+ | Default | `false` |
56
+
57
+ ```typescript [infinite: {}, hooks: true]
58
+ export function getPetsInfiniteQueryOptions(/* ... */) {
59
+ return infiniteQueryOptions({ queryKey, queryFn, initialPageParam, getNextPageParam })
60
+ }
61
+
62
+ export function useGetPetsInfiniteQuery(/* ... */) {
63
+ return useInfiniteQuery(getPetsInfiniteQueryOptions(/* ... */))
64
+ }
65
+ ```
66
+
67
+ #### infinite.queryParam
68
+
69
+ Name of the query parameter that holds the page cursor.
70
+
71
+ | | |
72
+ | -------- | -------- |
73
+ | Type | `string` |
74
+ | Required | `false` |
75
+ | Default | `'id'` |
76
+
77
+ #### infinite.initialPageParam
78
+
79
+ Initial value for `pageParam` on the first fetch.
80
+
81
+ | | |
82
+ | -------- | --------- |
83
+ | Type | `unknown` |
84
+ | Required | `false` |
85
+ | Default | `0` |
86
+
87
+ #### infinite.nextParam
88
+
89
+ Path to the next-page cursor on the response, as dot notation (`'pagination.next.id'`) or array form (`['pagination', 'next', 'id']`).
90
+
91
+ | | |
92
+ | -------- | --------------------------------- |
93
+ | Type | `string \| Array<string> \| null` |
94
+ | Required | `false` |
95
+ | Default | `null` |
96
+
97
+ #### infinite.previousParam
98
+
99
+ Path to the previous-page cursor on the response, in the same dot or array form.
100
+
101
+ | | |
102
+ | -------- | --------------------------------- |
103
+ | Type | `string \| Array<string> \| null` |
104
+ | Required | `false` |
105
+ | Default | `null` |
106
+
107
+ #### infinite.cursorParam
108
+
109
+ Deprecated path to the cursor field, read for both `getNextPageParam` and `getPreviousPageParam` when set. Use `nextParam` and `previousParam` instead.
110
+
111
+ | | |
112
+ | -------- | ---------------- |
113
+ | Type | `string \| null` |
114
+ | Required | `false` |
115
+ | Default | `null` |
116
+
117
+ #### infinite.getNextPageParam
118
+
119
+ Source code for TanStack Query's `getNextPageParam`, copied into the generated code as written, such as `'(lastPage) => (lastPage.hasNext ? lastPage.number + 1 : undefined)'`. Use it when the next page must be computed instead of read from a field. Takes precedence over `nextParam` and `cursorParam`.
120
+
121
+ | | |
122
+ | -------- | ---------------- |
123
+ | Type | `string \| null` |
124
+ | Required | `false` |
125
+ | Default | `null` |
126
+
127
+ Without `getNextPageParam`, `nextParam` or `cursorParam`, the composable counts pages up from `initialPageParam` until a page is an empty array. This works only for array responses, so generation warns when the response is an object.
128
+
129
+ #### infinite.getPreviousPageParam
130
+
131
+ Source code for TanStack Query's `getPreviousPageParam`, copied into the generated code as written. Takes precedence over `previousParam` and `cursorParam`.
132
+
133
+ | | |
134
+ | -------- | ---------------- |
135
+ | Type | `string \| null` |
136
+ | Required | `false` |
137
+ | Default | `null` |
138
+
139
+ ### query
140
+
141
+ Decides which operations are treated as queries. The plugin generates a `queryOptions` factory for each match by default. Pass `false` to skip, or set [`hooks`](#hooks) to also emit `useQuery`.
142
+
143
+ | | |
144
+ | -------- | --------------------------------------------------------- |
145
+ | Type | `Partial<Query> \| false` |
146
+ | Required | `false` |
147
+ | Default | `{ methods: ['GET'], importPath: '@tanstack/vue-query' }` |
148
+
149
+ #### query.methods
150
+
151
+ HTTP methods treated as queries. A matching operation generates a `queryOptions` factory instead of a mutation.
152
+
153
+ | | |
154
+ | -------- | --------------- |
155
+ | Type | `Array<string>` |
156
+ | Required | `false` |
157
+ | Default | `['GET']` |
158
+
159
+ #### query.importPath
160
+
161
+ Module specifier for the generated `import { queryOptions } from '...'`.
162
+
163
+ | | |
164
+ | -------- | ----------------------- |
165
+ | Type | `string` |
166
+ | Required | `false` |
167
+ | Default | `'@tanstack/vue-query'` |
168
+
169
+ ### queryKey
170
+
171
+ Builds the `queryKey` for each query composable. The callback receives the operation `node`, the active `casing` and the `variant` (`'query'` or `'infiniteQuery'`) and returns the key array. Strings are copied into the generated code as written, so wrap a string literal in `JSON.stringify(...)`. The default adds `infinite: true` to infinite keys so they never share a cache entry with the plain query.
172
+
173
+ | | |
174
+ | -------- | ------------------------------------------------------ |
175
+ | Type | `(props: { node, casing, variant }) => Array<unknown>` |
176
+ | Required | `false` |
177
+ | Default | Built-in `queryKeyTransformer` |
178
+
179
+ ::code-group
180
+
181
+ ```typescript [queryKey builder]
182
+ queryKey: ({ node, variant }) => [JSON.stringify({ variant, operationId: node.operationId })]
183
+ ```
184
+
185
+ ```typescript [Generated output]
186
+ export const getUserByNameQueryKey = () => [{ variant: 'query', operationId: 'getUserByName' }] as const
187
+ ```
188
+
189
+ ::
190
+
191
+ ### mutation
192
+
193
+ Decides which operations are treated as mutations. The plugin generates a `mutationKey` helper for each match by default. Pass `false` to skip, or set [`hooks`](#hooks) to also emit `useMutation`.
194
+
195
+ | | |
196
+ | -------- | ------------------------------------------------------------------------------------ |
197
+ | Type | `Partial<Mutation> \| false` |
198
+ | Required | `false` |
199
+ | Default | `{ methods: ['POST', 'PUT', 'PATCH', 'DELETE'], importPath: '@tanstack/vue-query' }` |
200
+
201
+ #### mutation.methods
202
+
203
+ HTTP methods treated as mutations. A matching operation generates mutation output instead of a query.
204
+
205
+ | | |
206
+ | -------- | ------------------------------------ |
207
+ | Type | `Array<string>` |
208
+ | Required | `false` |
209
+ | Default | `['POST', 'PUT', 'PATCH', 'DELETE']` |
210
+
211
+ #### mutation.importPath
212
+
213
+ Module specifier for the generated `import { useMutation } from '...'`, emitted when [`hooks`](#hooks) is set.
214
+
215
+ | | |
216
+ | -------- | ----------------------- |
217
+ | Type | `string` |
218
+ | Required | `false` |
219
+ | Default | `'@tanstack/vue-query'` |
220
+
221
+ ### mutationKey
222
+
223
+ Builds the `mutationKey` for each mutation composable, useful for batching invalidations. It takes the same props as `queryKey` with `variant: 'mutation'` and inlines strings the same way, so wrap literals in `JSON.stringify(...)`.
224
+
225
+ | | |
226
+ | -------- | ------------------------------------------------------ |
227
+ | Type | `(props: { node, casing, variant }) => Array<unknown>` |
228
+ | Required | `false` |
229
+ | Default | Built-in `mutationKeyTransformer` |
230
+
231
+ ### hooks
232
+
233
+ Controls whether `use*` composables are emitted. The default `false` writes only the `queryOptions`, `queryKey`, and `mutationKey` factory helpers. Set `true` to also generate `useQuery`, `useInfiniteQuery`, and `useMutation`.
234
+
235
+ | | |
236
+ | -------- | --------- |
237
+ | Type | `boolean` |
238
+ | Required | `false` |
239
+ | Default | `false` |
240
+
241
+ ### resolver
242
+
243
+ Overrides generated file and symbol names. Omitted members keep `resolverVueQuery`. The shared members (`name`, `file`, `imports`) and the `this` context are described under [`resolver`](https://kubb.dev/docs/5.x/reference/plugin-options#resolver).
244
+
245
+ | | |
246
+ | -------- | --------------------------------- |
247
+ | Type | `ResolverPatch<ResolverVueQuery>` |
248
+ | Required | `false` |
249
+
250
+ ::code-collapse{name="ResolverVueQuery patch members"}
251
+
252
+ ```typescript [Partial override]
253
+ type ResolverVueQueryPatch = {
254
+ // plus the shared name, file, and imports members
255
+ query?: {
256
+ name?(node: OperationNode): string
257
+ optionsName?(node: OperationNode): string
258
+ keyName?(node: OperationNode): string
259
+ keyTypeName?(node: OperationNode): string
260
+ clientName?(node: OperationNode): string
261
+ }
262
+ infiniteQuery?: { /* same members as query */ }
263
+ mutation?: {
264
+ name?(node: OperationNode): string
265
+ keyName?(node: OperationNode): string
266
+ typeName?(node: OperationNode): string
267
+ }
268
+ }
269
+ ```
270
+
271
+ ::
@@ -0,0 +1,41 @@
1
+ # Vue Query
2
+
3
+ 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.
4
+
5
+ The plugin ships no HTTP client. Each helper calls a function generated by a client plugin.
6
+
7
+ ## Setup
8
+
9
+ - Add `@kubb/plugin-ts` and a client plugin: `@kubb/plugin-fetch` or `@kubb/plugin-axios`.
10
+ - Install `@tanstack/vue-query` v5 or higher in the app that uses the generated code.
11
+ - Configure validation on the client plugin, not here.
12
+
13
+ ## Options worth knowing
14
+
15
+ - `client` picks `fetch` or `axios` when both client plugins are registered. A single client is detected automatically.
16
+ - `hooks` adds the `use*` composables on top of the option factories.
17
+ - `infinite` adds infinite queries for pagination. Set `infinite.queryParam` to the query parameter that holds the page cursor.
18
+ - `query` and `mutation` set which HTTP methods become queries (`GET`) and mutations (`POST`, `PUT`, `PATCH`, `DELETE`), and where the TanStack Query runtime is imported from. Set either to `false` to skip it.
19
+
20
+ ## Example
21
+
22
+ ```typescript [kubb.config.ts]
23
+ import { defineConfig } from 'kubb/config'
24
+ import { pluginTs } from '@kubb/plugin-ts'
25
+ import { pluginFetch } from '@kubb/plugin-fetch'
26
+ import { pluginVueQuery } from '@kubb/plugin-vue-query'
27
+
28
+ export default defineConfig({
29
+ input: './petStore.yaml',
30
+ output: { path: './src/gen' },
31
+ plugins: [
32
+ pluginTs(),
33
+ pluginFetch(),
34
+ pluginVueQuery({ hooks: true }),
35
+ ],
36
+ })
37
+ ```
38
+
39
+ ## See also
40
+
41
+ - [TanStack Query for Vue](https://tanstack.com/query/latest/docs/framework/vue/overview)
@@ -0,0 +1,215 @@
1
+ {
2
+ "$schema": "https://kubb.dev/schemas/kubb-extension.json",
3
+ "kind": "plugin",
4
+ "name": "plugin-vue-query",
5
+ "export": "pluginVueQuery",
6
+ "displayName": "Vue Query",
7
+ "description": "Generates TanStack Query composables for Vue from your OpenAPI spec, so every read and write is a typed useQuery, useInfiniteQuery, or useMutation.",
8
+ "category": "framework",
9
+ "icon": {
10
+ "light": "https://kubb.dev/feature/tanstack.svg"
11
+ },
12
+ "tags": ["vue-query", "tanstack-query", "vue", "composables", "data-fetching", "codegen", "openapi"],
13
+ "docs": "https://kubb.dev/extensions/kubb-labs/plugin-vue-query",
14
+ "maintainers": [
15
+ {
16
+ "name": "Stijn Van Hulle",
17
+ "github": "stijnvanhulle"
18
+ }
19
+ ],
20
+ "dependencies": ["plugin-ts"],
21
+ "compatibility": {
22
+ "kubb": ">=5.8.3",
23
+ "node": ">=22"
24
+ },
25
+ "role": "consumer",
26
+ "options": [
27
+ {
28
+ "key": "outputPath",
29
+ "path": ["output", "path"],
30
+ "label": "Output Path",
31
+ "description": "Output folder for generated files",
32
+ "type": "text",
33
+ "default": "hooks"
34
+ },
35
+ {
36
+ "key": "barrel",
37
+ "path": ["output", "barrel"],
38
+ "label": "Barrel",
39
+ "description": "How index.ts barrel files are generated",
40
+ "type": "select",
41
+ "default": {
42
+ "type": "named"
43
+ },
44
+ "choices": [
45
+ {
46
+ "label": "named",
47
+ "value": {
48
+ "type": "named"
49
+ }
50
+ },
51
+ {
52
+ "label": "named (nested)",
53
+ "value": {
54
+ "type": "named",
55
+ "nested": true
56
+ }
57
+ },
58
+ {
59
+ "label": "all",
60
+ "value": {
61
+ "type": "all"
62
+ }
63
+ },
64
+ {
65
+ "label": "all (nested)",
66
+ "value": {
67
+ "type": "all",
68
+ "nested": true
69
+ }
70
+ },
71
+ {
72
+ "label": "false (disabled)",
73
+ "value": false
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ "key": "outputMode",
79
+ "path": ["output", "mode"],
80
+ "label": "Output Mode",
81
+ "description": "How the plugin consolidates its code into files. File mode writes everything into a single file, so the output path must include a file extension and cannot be grouped.",
82
+ "type": "select",
83
+ "default": "directory",
84
+ "choices": [
85
+ {
86
+ "label": "directory (one file per schema)",
87
+ "value": "directory"
88
+ },
89
+ {
90
+ "label": "file (single file)",
91
+ "value": "file"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "key": "client",
97
+ "path": ["client"],
98
+ "label": "Client",
99
+ "description": "HTTP client the generated hooks call. Only needed to disambiguate when both plugin-fetch and plugin-axios are enabled",
100
+ "type": "select",
101
+ "default": null,
102
+ "choices": [
103
+ {
104
+ "label": "auto-detect",
105
+ "value": null
106
+ },
107
+ {
108
+ "label": "fetch",
109
+ "value": "fetch"
110
+ },
111
+ {
112
+ "label": "axios",
113
+ "value": "axios"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "key": "group",
119
+ "path": ["group"],
120
+ "label": "Group",
121
+ "description": "Group generated operations by OpenAPI tag or path",
122
+ "type": "select",
123
+ "default": null,
124
+ "choices": [
125
+ {
126
+ "label": "none",
127
+ "value": null
128
+ },
129
+ {
130
+ "label": "by tag",
131
+ "value": {
132
+ "type": "tag"
133
+ }
134
+ },
135
+ {
136
+ "label": "by path",
137
+ "value": {
138
+ "type": "path"
139
+ }
140
+ }
141
+ ]
142
+ },
143
+ {
144
+ "key": "excludeTags",
145
+ "path": ["exclude"],
146
+ "label": "Exclude Tags",
147
+ "description": "Comma-separated OpenAPI tags to exclude from generation",
148
+ "type": "list",
149
+ "item": {
150
+ "type": "tag",
151
+ "pattern": "$item"
152
+ }
153
+ },
154
+ {
155
+ "key": "includeTags",
156
+ "path": ["include"],
157
+ "label": "Include Tags",
158
+ "description": "Comma-separated OpenAPI tags to include. Only operations with these tags are generated",
159
+ "type": "list",
160
+ "item": {
161
+ "type": "tag",
162
+ "pattern": "$item"
163
+ }
164
+ },
165
+ {
166
+ "key": "hooks",
167
+ "path": ["hooks"],
168
+ "label": "Hooks",
169
+ "description": "Generate use* functions instead of only queryOptions and mutation helpers",
170
+ "type": "boolean",
171
+ "default": false
172
+ },
173
+ {
174
+ "key": "infiniteQueryParam",
175
+ "path": ["infinite", "queryParam"],
176
+ "label": "Infinite Query Param",
177
+ "description": "Enable infinite queries, set the pageParam key (e.g. \"id\"). Leave empty to disable.",
178
+ "type": "text"
179
+ },
180
+ {
181
+ "key": "queryMethods",
182
+ "path": ["query", "methods"],
183
+ "label": "Query Methods",
184
+ "description": "Comma-separated HTTP methods treated as queries (default: GET)",
185
+ "type": "list",
186
+ "default": ["GET"],
187
+ "itemCase": "upper"
188
+ },
189
+ {
190
+ "key": "queryImportPath",
191
+ "path": ["query", "importPath"],
192
+ "label": "Query Import Path",
193
+ "description": "Module specifier the generated query hook imports from",
194
+ "type": "text",
195
+ "default": "@tanstack/vue-query"
196
+ },
197
+ {
198
+ "key": "mutationMethods",
199
+ "path": ["mutation", "methods"],
200
+ "label": "Mutation Methods",
201
+ "description": "Comma-separated HTTP methods treated as mutations (default: POST, PUT, PATCH, DELETE)",
202
+ "type": "list",
203
+ "default": ["POST", "PUT", "PATCH", "DELETE"],
204
+ "itemCase": "upper"
205
+ },
206
+ {
207
+ "key": "mutationImportPath",
208
+ "path": ["mutation", "importPath"],
209
+ "label": "Mutation Import Path",
210
+ "description": "Module specifier the generated mutation hook imports from",
211
+ "type": "text",
212
+ "default": "@tanstack/vue-query"
213
+ }
214
+ ]
215
+ }