@kubb/plugin-vue-query 3.7.4 → 3.7.5

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.
Files changed (38) hide show
  1. package/dist/{chunk-6BI5N5ZM.cjs → chunk-6LOMKNVI.cjs} +20 -20
  2. package/dist/chunk-6LOMKNVI.cjs.map +1 -0
  3. package/dist/{chunk-OVYZOWDO.js → chunk-6MAOBT27.js} +13 -13
  4. package/dist/chunk-6MAOBT27.js.map +1 -0
  5. package/dist/{chunk-6K5ZLFYC.cjs → chunk-EGPHAXF4.cjs} +13 -13
  6. package/dist/chunk-EGPHAXF4.cjs.map +1 -0
  7. package/dist/{chunk-VG3HU7R3.js → chunk-S43NG2P5.js} +6 -6
  8. package/dist/chunk-S43NG2P5.js.map +1 -0
  9. package/dist/components.cjs +8 -8
  10. package/dist/components.js +1 -1
  11. package/dist/generators.cjs +5 -5
  12. package/dist/generators.js +2 -2
  13. package/dist/index.cjs +5 -5
  14. package/dist/index.js +2 -2
  15. package/package.json +10 -10
  16. package/src/components/InfiniteQuery.tsx +4 -4
  17. package/src/components/Mutation.tsx +3 -3
  18. package/src/components/Query.tsx +4 -4
  19. package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +13 -8
  20. package/src/generators/__snapshots__/clientGetImportPath.ts +13 -8
  21. package/src/generators/__snapshots__/clientPostImportPath.ts +12 -9
  22. package/src/generators/__snapshots__/findByTags.ts +13 -8
  23. package/src/generators/__snapshots__/findByTagsObject.ts +13 -8
  24. package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +13 -8
  25. package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +13 -8
  26. package/src/generators/__snapshots__/findByTagsWithZod.ts +13 -8
  27. package/src/generators/__snapshots__/findInfiniteByTags.ts +13 -8
  28. package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +13 -8
  29. package/src/generators/__snapshots__/postAsQuery.ts +13 -8
  30. package/src/generators/__snapshots__/updatePetById.ts +12 -9
  31. package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +12 -9
  32. package/src/generators/infiniteQueryGenerator.tsx +1 -1
  33. package/src/generators/mutationGenerator.tsx +1 -1
  34. package/src/generators/queryGenerator.tsx +1 -1
  35. package/dist/chunk-6BI5N5ZM.cjs.map +0 -1
  36. package/dist/chunk-6K5ZLFYC.cjs.map +0 -1
  37. package/dist/chunk-OVYZOWDO.js.map +0 -1
  38. package/dist/chunk-VG3HU7R3.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-vue-query",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "description": "Generator vue-query hooks",
5
5
  "keywords": [
6
6
  "faker",
@@ -63,21 +63,21 @@
63
63
  ],
64
64
  "dependencies": {
65
65
  "remeda": "^2.21.2",
66
- "@kubb/core": "3.7.4",
67
- "@kubb/fs": "3.7.4",
68
- "@kubb/oas": "3.7.4",
69
- "@kubb/plugin-ts": "3.7.4",
70
- "@kubb/plugin-zod": "3.7.4",
71
- "@kubb/plugin-oas": "3.7.4",
72
- "@kubb/react": "3.7.4"
66
+ "@kubb/core": "3.7.5",
67
+ "@kubb/fs": "3.7.5",
68
+ "@kubb/oas": "3.7.5",
69
+ "@kubb/plugin-oas": "3.7.5",
70
+ "@kubb/plugin-ts": "3.7.5",
71
+ "@kubb/plugin-zod": "3.7.5",
72
+ "@kubb/react": "3.7.5"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@types/react": "^18.3.20",
76
76
  "react": "^18.3.1",
77
77
  "tsup": "^8.4.0",
78
78
  "typescript": "^5.8.3",
79
- "@kubb/config-ts": "3.7.4",
80
- "@kubb/config-tsup": "3.7.4"
79
+ "@kubb/config-ts": "3.7.5",
80
+ "@kubb/config-tsup": "3.7.5"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@kubb/react": "^3.0.0"
@@ -74,7 +74,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
74
74
  options: {
75
75
  type: `
76
76
  {
77
- query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
77
+ query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
78
78
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
79
79
  }
80
80
  `,
@@ -119,7 +119,7 @@ function getParams({ paramsType, paramsCasing, pathParamsType, dataReturnType, t
119
119
  options: {
120
120
  type: `
121
121
  {
122
- query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
122
+ query?: Partial<InfiniteQueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
123
123
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
124
124
  }
125
125
  `,
@@ -178,14 +178,14 @@ export function InfiniteQuery({
178
178
  }}
179
179
  >
180
180
  {`
181
- const { query: queryOptions, client: config = {} } = options ?? {}
181
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
182
182
  const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
183
183
 
184
184
  const query = useInfiniteQuery({
185
185
  ...${queryOptions},
186
186
  queryKey: queryKey as QueryKey,
187
187
  ...queryOptions as unknown as Omit<InfiniteQueryObserverOptions, "queryKey">
188
- }) as ${returnType}
188
+ }, queryClient) as ${returnType}
189
189
 
190
190
  query.queryKey = queryKey as TQueryKey
191
191
 
@@ -72,7 +72,7 @@ function getParams({ paramsCasing, dataReturnType, typeSchemas }: GetParamsProps
72
72
  options: {
73
73
  type: `
74
74
  {
75
- mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}>,
75
+ mutation?: MutationObserverOptions<${[TData, TError, TRequest ? `{${TRequest}}` : 'void', 'TContext'].join(', ')}> & { client?: QueryClient },
76
76
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'},
77
77
  }
78
78
  `,
@@ -168,7 +168,7 @@ export function Mutation({
168
168
  generics={['TContext']}
169
169
  >
170
170
  {`
171
- const { mutation: mutationOptions, client: config = {} } = options ?? {}
171
+ const { mutation: { client: queryClient, ...mutationOptions } = {}, client: config = {} } = options ?? {}
172
172
  const mutationKey = mutationOptions?.mutationKey ?? ${mutationKeyName}(${mutationKeyParams.toCall()})
173
173
 
174
174
  return useMutation<${generics}>({
@@ -177,7 +177,7 @@ export function Mutation({
177
177
  },
178
178
  mutationKey,
179
179
  ...mutationOptions
180
- })
180
+ }, queryClient)
181
181
  `}
182
182
  </Function>
183
183
  </File.Source>
@@ -75,7 +75,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
75
75
  options: {
76
76
  type: `
77
77
  {
78
- query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
78
+ query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
79
79
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
80
80
  }
81
81
  `,
@@ -120,7 +120,7 @@ function getParams({ paramsCasing, paramsType, pathParamsType, dataReturnType, t
120
120
  options: {
121
121
  type: `
122
122
  {
123
- query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
123
+ query?: Partial<QueryObserverOptions<${[TData, TError, 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>> & { client?: QueryClient },
124
124
  client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: typeof client }` : 'Partial<RequestConfig> & { client?: typeof client }'}
125
125
  }
126
126
  `,
@@ -179,14 +179,14 @@ export function Query({
179
179
  }}
180
180
  >
181
181
  {`
182
- const { query: queryOptions, client: config = {} } = options ?? {}
182
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
183
183
  const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
184
184
 
185
185
  const query = useQuery({
186
186
  ...${queryOptions},
187
187
  queryKey: queryKey as QueryKey,
188
188
  ...queryOptions as unknown as Omit<QueryObserverOptions, "queryKey">
189
- }) as ${returnType}
189
+ }, queryClient) as ${returnType}
190
190
 
191
191
  query.queryKey = queryKey as TQueryKey
192
192
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -64,18 +64,23 @@ export function useFindPetsByTags<
64
64
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
65
65
  params?: MaybeRef<FindPetsByTagsQueryParams>,
66
66
  options: {
67
- query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
67
+ query?: Partial<QueryObserverOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
68
+ client?: QueryClient
69
+ }
68
70
  client?: Partial<RequestConfig> & { client?: typeof client }
69
71
  } = {},
70
72
  ) {
71
- const { query: queryOptions, client: config = {} } = options ?? {}
73
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
72
74
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
73
75
 
74
- const query = useQuery({
75
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
76
- queryKey: queryKey as QueryKey,
77
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
78
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
76
+ const query = useQuery(
77
+ {
78
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
79
+ queryKey: queryKey as QueryKey,
80
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
81
+ },
82
+ queryClient,
83
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
79
84
 
80
85
  query.queryKey = queryKey as TQueryKey
81
86
 
@@ -1,5 +1,5 @@
1
1
  import client from 'axios'
2
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
2
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
3
  import type { RequestConfig, ResponseErrorConfig } from 'axios'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
59
59
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
60
60
  params?: MaybeRef<FindPetsByTagsQueryParams>,
61
61
  options: {
62
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
62
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
63
+ client?: QueryClient
64
+ }
63
65
  client?: Partial<RequestConfig> & { client?: typeof client }
64
66
  } = {},
65
67
  ) {
66
- const { query: queryOptions, client: config = {} } = options ?? {}
68
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
67
69
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
68
70
 
69
- const query = useQuery({
70
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
71
- queryKey: queryKey as QueryKey,
72
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
73
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
71
+ const query = useQuery(
72
+ {
73
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
74
+ queryKey: queryKey as QueryKey,
75
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
76
+ },
77
+ queryClient,
78
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
74
79
 
75
80
  query.queryKey = queryKey as TQueryKey
76
81
 
@@ -1,5 +1,5 @@
1
1
  import client from 'axios'
2
- import type { MutationObserverOptions } from '@tanstack/vue-query'
2
+ import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
3
3
  import type { RequestConfig, ResponseErrorConfig } from 'axios'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { useMutation } from '@tanstack/vue-query'
@@ -45,11 +45,11 @@ export function useUpdatePetWithForm<TContext>(
45
45
  params?: MaybeRef<UpdatePetWithFormQueryParams>
46
46
  },
47
47
  TContext
48
- >
48
+ > & { client?: QueryClient }
49
49
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
50
50
  } = {},
51
51
  ) {
52
- const { mutation: mutationOptions, client: config = {} } = options ?? {}
52
+ const { mutation: { client: queryClient, ...mutationOptions } = {}, client: config = {} } = options ?? {}
53
53
  const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
54
54
 
55
55
  return useMutation<
@@ -57,11 +57,14 @@ export function useUpdatePetWithForm<TContext>(
57
57
  ResponseErrorConfig<UpdatePetWithForm405>,
58
58
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
59
59
  TContext
60
- >({
61
- mutationFn: async ({ petId, data, params }) => {
62
- return updatePetWithForm(petId, data, params, config)
60
+ >(
61
+ {
62
+ mutationFn: async ({ petId, data, params }) => {
63
+ return updatePetWithForm(petId, data, params, config)
64
+ },
65
+ mutationKey,
66
+ ...mutationOptions,
63
67
  },
64
- mutationKey,
65
- ...mutationOptions,
66
- })
68
+ queryClient,
69
+ )
67
70
  }
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
59
59
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
60
60
  params?: MaybeRef<FindPetsByTagsQueryParams>,
61
61
  options: {
62
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
62
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
63
+ client?: QueryClient
64
+ }
63
65
  client?: Partial<RequestConfig> & { client?: typeof client }
64
66
  } = {},
65
67
  ) {
66
- const { query: queryOptions, client: config = {} } = options ?? {}
68
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
67
69
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
68
70
 
69
- const query = useQuery({
70
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
71
- queryKey: queryKey as QueryKey,
72
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
73
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
71
+ const query = useQuery(
72
+ {
73
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
74
+ queryKey: queryKey as QueryKey,
75
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
76
+ },
77
+ queryClient,
78
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
74
79
 
75
80
  query.queryKey = queryKey as TQueryKey
76
81
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -56,18 +56,23 @@ export function useFindPetsByTags<
56
56
  >(
57
57
  { headers, params }: { headers: MaybeRef<FindPetsByTagsHeaderParams>; params?: MaybeRef<FindPetsByTagsQueryParams> },
58
58
  options: {
59
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
59
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
60
+ client?: QueryClient
61
+ }
60
62
  client?: Partial<RequestConfig> & { client?: typeof client }
61
63
  } = {},
62
64
  ) {
63
- const { query: queryOptions, client: config = {} } = options ?? {}
65
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
64
66
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
65
67
 
66
- const query = useQuery({
67
- ...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions),
68
- queryKey: queryKey as QueryKey,
69
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
70
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
68
+ const query = useQuery(
69
+ {
70
+ ...(findPetsByTagsQueryOptions({ headers, params }, config) as unknown as QueryObserverOptions),
71
+ queryKey: queryKey as QueryKey,
72
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
73
+ },
74
+ queryClient,
75
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
71
76
 
72
77
  query.queryKey = queryKey as TQueryKey
73
78
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
59
59
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
60
60
  params?: MaybeRef<FindPetsByTagsQueryParams>,
61
61
  options: {
62
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
62
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
63
+ client?: QueryClient
64
+ }
63
65
  client?: Partial<RequestConfig> & { client?: typeof client }
64
66
  } = {},
65
67
  ) {
66
- const { query: queryOptions, client: config = {} } = options ?? {}
68
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
67
69
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
68
70
 
69
- const query = useQuery({
70
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
71
- queryKey: queryKey as QueryKey,
72
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
73
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
71
+ const query = useQuery(
72
+ {
73
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
74
+ queryKey: queryKey as QueryKey,
75
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
76
+ },
77
+ queryClient,
78
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
74
79
 
75
80
  query.queryKey = queryKey as TQueryKey
76
81
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -60,18 +60,23 @@ export function useFindPetsByTags<
60
60
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
61
61
  params?: MaybeRef<FindPetsByTagsQueryParams>,
62
62
  options: {
63
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
63
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
64
+ client?: QueryClient
65
+ }
64
66
  client?: Partial<RequestConfig> & { client?: typeof client }
65
67
  } = {},
66
68
  ) {
67
- const { query: queryOptions, client: config = {} } = options ?? {}
69
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
68
70
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
69
71
 
70
- const query = useQuery({
71
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
72
- queryKey: queryKey as QueryKey,
73
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
74
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
72
+ const query = useQuery(
73
+ {
74
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
75
+ queryKey: queryKey as QueryKey,
76
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
77
+ },
78
+ queryClient,
79
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
75
80
 
76
81
  query.queryKey = queryKey as TQueryKey
77
82
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from '@tanstack/react-query'
6
6
  import { unref } from 'vue'
@@ -59,18 +59,23 @@ export function useFindPetsByTags<
59
59
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
60
60
  params?: MaybeRef<FindPetsByTagsQueryParams>,
61
61
  options: {
62
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
62
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
63
+ client?: QueryClient
64
+ }
63
65
  client?: Partial<RequestConfig> & { client?: typeof client }
64
66
  } = {},
65
67
  ) {
66
- const { query: queryOptions, client: config = {} } = options ?? {}
68
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
67
69
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsQueryKey(params)
68
70
 
69
- const query = useQuery({
70
- ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
71
- queryKey: queryKey as QueryKey,
72
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
73
- }) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
71
+ const query = useQuery(
72
+ {
73
+ ...(findPetsByTagsQueryOptions(headers, params, config) as unknown as QueryObserverOptions),
74
+ queryKey: queryKey as QueryKey,
75
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
76
+ },
77
+ queryClient,
78
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
74
79
 
75
80
  query.queryKey = queryKey as TQueryKey
76
81
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { InfiniteData, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
3
+ import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
6
6
 
@@ -66,18 +66,23 @@ export function useFindPetsByTagsInfinite<
66
66
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
67
67
  params?: MaybeRef<FindPetsByTagsQueryParams>,
68
68
  options: {
69
- query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
69
+ query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
70
+ client?: QueryClient
71
+ }
70
72
  client?: Partial<RequestConfig> & { client?: typeof client }
71
73
  } = {},
72
74
  ) {
73
- const { query: queryOptions, client: config = {} } = options ?? {}
75
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
74
76
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params)
75
77
 
76
- const query = useInfiniteQuery({
77
- ...(findPetsByTagsInfiniteQueryOptions(headers, params, config) as unknown as InfiniteQueryObserverOptions),
78
- queryKey: queryKey as QueryKey,
79
- ...(queryOptions as unknown as Omit<InfiniteQueryObserverOptions, 'queryKey'>),
80
- }) as UseInfiniteQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
78
+ const query = useInfiniteQuery(
79
+ {
80
+ ...(findPetsByTagsInfiniteQueryOptions(headers, params, config) as unknown as InfiniteQueryObserverOptions),
81
+ queryKey: queryKey as QueryKey,
82
+ ...(queryOptions as unknown as Omit<InfiniteQueryObserverOptions, 'queryKey'>),
83
+ },
84
+ queryClient,
85
+ ) as UseInfiniteQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
81
86
 
82
87
  query.queryKey = queryKey as TQueryKey
83
88
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { InfiniteData, QueryKey, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
3
+ import type { InfiniteData, QueryKey, QueryClient, InfiniteQueryObserverOptions, UseInfiniteQueryReturnType } from '@tanstack/react-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
6
6
 
@@ -66,18 +66,23 @@ export function useFindPetsByTagsInfinite<
66
66
  headers: MaybeRef<FindPetsByTagsHeaderParams>,
67
67
  params?: MaybeRef<FindPetsByTagsQueryParams>,
68
68
  options: {
69
- query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
69
+ query?: Partial<InfiniteQueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>> & {
70
+ client?: QueryClient
71
+ }
70
72
  client?: Partial<RequestConfig> & { client?: typeof client }
71
73
  } = {},
72
74
  ) {
73
- const { query: queryOptions, client: config = {} } = options ?? {}
75
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
74
76
  const queryKey = queryOptions?.queryKey ?? findPetsByTagsInfiniteQueryKey(params)
75
77
 
76
- const query = useInfiniteQuery({
77
- ...(findPetsByTagsInfiniteQueryOptions(headers, params, config) as unknown as InfiniteQueryObserverOptions),
78
- queryKey: queryKey as QueryKey,
79
- ...(queryOptions as unknown as Omit<InfiniteQueryObserverOptions, 'queryKey'>),
80
- }) as UseInfiniteQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
78
+ const query = useInfiniteQuery(
79
+ {
80
+ ...(findPetsByTagsInfiniteQueryOptions(headers, params, config) as unknown as InfiniteQueryObserverOptions),
81
+ queryKey: queryKey as QueryKey,
82
+ ...(queryOptions as unknown as Omit<InfiniteQueryObserverOptions, 'queryKey'>),
83
+ },
84
+ queryClient,
85
+ ) as UseInfiniteQueryReturnType<TData, ResponseErrorConfig<FindPetsByTags400>> & { queryKey: TQueryKey }
81
86
 
82
87
  query.queryKey = queryKey as TQueryKey
83
88
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { QueryKey, QueryObserverOptions, UseQueryReturnType } from 'custom-query'
3
+ import type { QueryKey, QueryClient, QueryObserverOptions, UseQueryReturnType } from 'custom-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { queryOptions, useQuery } from 'custom-query'
6
6
  import { unref } from 'vue'
@@ -65,18 +65,23 @@ export function useUpdatePetWithForm<
65
65
  data?: MaybeRef<UpdatePetWithFormMutationRequest>,
66
66
  params?: MaybeRef<UpdatePetWithFormQueryParams>,
67
67
  options: {
68
- query?: Partial<QueryObserverOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>>
68
+ query?: Partial<QueryObserverOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, TData, TQueryData, TQueryKey>> & {
69
+ client?: QueryClient
70
+ }
69
71
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
70
72
  } = {},
71
73
  ) {
72
- const { query: queryOptions, client: config = {} } = options ?? {}
74
+ const { query: { client: queryClient, ...queryOptions } = {}, client: config = {} } = options ?? {}
73
75
  const queryKey = queryOptions?.queryKey ?? updatePetWithFormQueryKey(petId, data, params)
74
76
 
75
- const query = useQuery({
76
- ...(updatePetWithFormQueryOptions(petId, data, params, config) as unknown as QueryObserverOptions),
77
- queryKey: queryKey as QueryKey,
78
- ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
79
- }) as UseQueryReturnType<TData, ResponseErrorConfig<UpdatePetWithForm405>> & { queryKey: TQueryKey }
77
+ const query = useQuery(
78
+ {
79
+ ...(updatePetWithFormQueryOptions(petId, data, params, config) as unknown as QueryObserverOptions),
80
+ queryKey: queryKey as QueryKey,
81
+ ...(queryOptions as unknown as Omit<QueryObserverOptions, 'queryKey'>),
82
+ },
83
+ queryClient,
84
+ ) as UseQueryReturnType<TData, ResponseErrorConfig<UpdatePetWithForm405>> & { queryKey: TQueryKey }
80
85
 
81
86
  query.queryKey = queryKey as TQueryKey
82
87
 
@@ -1,6 +1,6 @@
1
1
  import client from '@kubb/plugin-client/clients/axios'
2
2
  import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
3
- import type { MutationObserverOptions } from '@tanstack/vue-query'
3
+ import type { MutationObserverOptions, QueryClient } from '@tanstack/vue-query'
4
4
  import type { MaybeRef } from 'vue'
5
5
  import { useMutation } from '@tanstack/vue-query'
6
6
 
@@ -45,11 +45,11 @@ export function useUpdatePetWithForm<TContext>(
45
45
  params?: MaybeRef<UpdatePetWithFormQueryParams>
46
46
  },
47
47
  TContext
48
- >
48
+ > & { client?: QueryClient }
49
49
  client?: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client }
50
50
  } = {},
51
51
  ) {
52
- const { mutation: mutationOptions, client: config = {} } = options ?? {}
52
+ const { mutation: { client: queryClient, ...mutationOptions } = {}, client: config = {} } = options ?? {}
53
53
  const mutationKey = mutationOptions?.mutationKey ?? updatePetWithFormMutationKey()
54
54
 
55
55
  return useMutation<
@@ -57,11 +57,14 @@ export function useUpdatePetWithForm<TContext>(
57
57
  ResponseErrorConfig<UpdatePetWithForm405>,
58
58
  { petId: UpdatePetWithFormPathParams['petId']; data?: UpdatePetWithFormMutationRequest; params?: UpdatePetWithFormQueryParams },
59
59
  TContext
60
- >({
61
- mutationFn: async ({ petId, data, params }) => {
62
- return updatePetWithForm(petId, data, params, config)
60
+ >(
61
+ {
62
+ mutationFn: async ({ petId, data, params }) => {
63
+ return updatePetWithForm(petId, data, params, config)
64
+ },
65
+ mutationKey,
66
+ ...mutationOptions,
63
67
  },
64
- mutationKey,
65
- ...mutationOptions,
66
- })
68
+ queryClient,
69
+ )
67
70
  }