@kubb/plugin-vue-query 5.0.0-alpha.9 → 5.0.0-beta.10
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.
- package/LICENSE +17 -10
- package/README.md +26 -7
- package/dist/components-B6jAb2as.js +1150 -0
- package/dist/components-B6jAb2as.js.map +1 -0
- package/dist/components-X0P-3W2G.cjs +1264 -0
- package/dist/components-X0P-3W2G.cjs.map +1 -0
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +66 -121
- package/dist/components.js +1 -1
- package/dist/generators-B33PbKzu.js +681 -0
- package/dist/generators-B33PbKzu.js.map +1 -0
- package/dist/generators-BE3KD0IR.cjs +698 -0
- package/dist/generators-BE3KD0IR.cjs.map +1 -0
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.ts +5 -501
- package/dist/generators.js +1 -1
- package/dist/index.cjs +150 -121
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +146 -121
- package/dist/index.js.map +1 -1
- package/dist/types-Bkm7bWT3.d.ts +243 -0
- package/extension.yaml +732 -0
- package/package.json +60 -65
- package/src/components/InfiniteQuery.tsx +71 -159
- package/src/components/InfiniteQueryOptions.tsx +115 -163
- package/src/components/Mutation.tsx +97 -134
- package/src/components/Query.tsx +68 -157
- package/src/components/QueryKey.tsx +23 -66
- package/src/components/QueryOptions.tsx +92 -143
- package/src/generators/infiniteQueryGenerator.tsx +152 -171
- package/src/generators/mutationGenerator.tsx +102 -125
- package/src/generators/queryGenerator.tsx +125 -137
- package/src/index.ts +1 -1
- package/src/plugin.ts +126 -177
- package/src/resolvers/resolverVueQuery.ts +65 -0
- package/src/types.ts +121 -52
- package/src/utils.ts +49 -0
- package/dist/components-Yjoe78Y7.cjs +0 -1119
- package/dist/components-Yjoe78Y7.cjs.map +0 -1
- package/dist/components-_AMBl0g-.js +0 -1029
- package/dist/components-_AMBl0g-.js.map +0 -1
- package/dist/generators-CR34GjVu.js +0 -661
- package/dist/generators-CR34GjVu.js.map +0 -1
- package/dist/generators-DH8VkK1q.cjs +0 -678
- package/dist/generators-DH8VkK1q.cjs.map +0 -1
- package/dist/types-CgDFUvfZ.d.ts +0 -211
package/package.json
CHANGED
|
@@ -1,37 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-vue-query",
|
|
3
|
-
"version": "5.0.0-
|
|
4
|
-
"description": "Vue Query
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
4
|
+
"description": "Generate type-safe TanStack Query (Vue Query) composables from your OpenAPI specification. Covers useQuery, useMutation, useInfiniteQuery, and queryOptions with Vue 3 Composition API support.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"vue.js",
|
|
9
|
-
"vue3",
|
|
10
|
-
"tanstack-query",
|
|
6
|
+
"code-generation",
|
|
7
|
+
"codegen",
|
|
11
8
|
"composables",
|
|
12
|
-
"
|
|
9
|
+
"composition-api",
|
|
13
10
|
"data-fetching",
|
|
14
|
-
"
|
|
15
|
-
"sdk-generator",
|
|
16
|
-
"typescript",
|
|
17
|
-
"type-safe",
|
|
11
|
+
"kubb",
|
|
18
12
|
"openapi",
|
|
19
13
|
"swagger",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
14
|
+
"tanstack",
|
|
15
|
+
"tanstack-query",
|
|
16
|
+
"typescript",
|
|
17
|
+
"use-mutation",
|
|
18
|
+
"use-query",
|
|
19
|
+
"vue",
|
|
20
|
+
"vue-query",
|
|
21
|
+
"vue3"
|
|
25
22
|
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "stijnvanhulle",
|
|
26
25
|
"repository": {
|
|
27
26
|
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/kubb-labs/
|
|
27
|
+
"url": "git+https://github.com/kubb-labs/plugins.git",
|
|
29
28
|
"directory": "packages/plugin-vue-query"
|
|
30
29
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
"files": [
|
|
31
|
+
"src",
|
|
32
|
+
"dist",
|
|
33
|
+
"extension.yaml",
|
|
34
|
+
"!/**/**.test.**",
|
|
35
|
+
"!/**/__tests__/**",
|
|
36
|
+
"!/**/__snapshots__/**"
|
|
37
|
+
],
|
|
34
38
|
"type": "module",
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"main": "./dist/index.cjs",
|
|
41
|
+
"module": "./dist/index.js",
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"components": [
|
|
46
|
+
"./dist/components.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"generators": [
|
|
49
|
+
"./dist/generators.d.ts"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
},
|
|
35
53
|
"exports": {
|
|
36
54
|
".": {
|
|
37
55
|
"import": "./dist/index.js",
|
|
@@ -47,24 +65,26 @@
|
|
|
47
65
|
},
|
|
48
66
|
"./package.json": "./package.json"
|
|
49
67
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public",
|
|
70
|
+
"registry": "https://registry.npmjs.org/"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@kubb/core": "5.0.0-beta.10",
|
|
74
|
+
"@kubb/renderer-jsx": "5.0.0-beta.10",
|
|
75
|
+
"remeda": "^2.34.0",
|
|
76
|
+
"@kubb/plugin-client": "5.0.0-beta.10",
|
|
77
|
+
"@kubb/plugin-ts": "5.0.0-beta.10",
|
|
78
|
+
"@kubb/plugin-zod": "5.0.0-beta.10"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@internals/shared": "0.0.0",
|
|
82
|
+
"@internals/tanstack-query": "0.0.0",
|
|
83
|
+
"@internals/utils": "0.0.0"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"@kubb/renderer-jsx": "5.0.0-beta.10"
|
|
60
87
|
},
|
|
61
|
-
"files": [
|
|
62
|
-
"src",
|
|
63
|
-
"dist",
|
|
64
|
-
"!/**/**.test.**",
|
|
65
|
-
"!/**/__tests__/**",
|
|
66
|
-
"!/**/__snapshots__/**"
|
|
67
|
-
],
|
|
68
88
|
"size-limit": [
|
|
69
89
|
{
|
|
70
90
|
"path": "./dist/*.js",
|
|
@@ -72,39 +92,14 @@
|
|
|
72
92
|
"gzip": true
|
|
73
93
|
}
|
|
74
94
|
],
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@kubb/fabric-core": "0.14.0",
|
|
77
|
-
"@kubb/react-fabric": "0.14.0",
|
|
78
|
-
"remeda": "^2.33.6",
|
|
79
|
-
"@kubb/oas": "5.0.0-alpha.9",
|
|
80
|
-
"@kubb/core": "5.0.0-alpha.9",
|
|
81
|
-
"@kubb/plugin-client": "5.0.0-alpha.9",
|
|
82
|
-
"@kubb/plugin-oas": "5.0.0-alpha.9",
|
|
83
|
-
"@kubb/plugin-ts": "5.0.0-alpha.9",
|
|
84
|
-
"@kubb/plugin-zod": "5.0.0-alpha.9"
|
|
85
|
-
},
|
|
86
|
-
"peerDependencies": {
|
|
87
|
-
"@kubb/fabric-core": "0.14.0",
|
|
88
|
-
"@kubb/react-fabric": "0.14.0"
|
|
89
|
-
},
|
|
90
95
|
"engines": {
|
|
91
96
|
"node": ">=22"
|
|
92
97
|
},
|
|
93
|
-
"publishConfig": {
|
|
94
|
-
"access": "public",
|
|
95
|
-
"registry": "https://registry.npmjs.org/"
|
|
96
|
-
},
|
|
97
|
-
"main": "./dist/index.cjs",
|
|
98
|
-
"module": "./dist/index.js",
|
|
99
|
-
"devDependencies": {
|
|
100
|
-
"@internals/tanstack-query": "0.0.0",
|
|
101
|
-
"@internals/utils": "0.0.0"
|
|
102
|
-
},
|
|
103
98
|
"scripts": {
|
|
104
99
|
"build": "tsdown && size-limit",
|
|
105
100
|
"clean": "npx rimraf ./dist",
|
|
106
|
-
"lint": "
|
|
107
|
-
"lint:fix": "
|
|
101
|
+
"lint": "oxlint .",
|
|
102
|
+
"lint:fix": "oxlint --fix .",
|
|
108
103
|
"release": "pnpm publish --no-git-check",
|
|
109
104
|
"release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
|
|
110
105
|
"start": "tsdown --watch",
|
|
@@ -1,139 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import { File, Function
|
|
5
|
-
import type {
|
|
6
|
-
import type { PluginVueQuery } from '../types.ts'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ast } from '@kubb/core'
|
|
2
|
+
import type { ResolverTs } from '@kubb/plugin-ts'
|
|
3
|
+
import { functionPrinter } from '@kubb/plugin-ts'
|
|
4
|
+
import { File, Function } from '@kubb/renderer-jsx'
|
|
5
|
+
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
6
|
+
import type { Infinite, PluginVueQuery } from '../types.ts'
|
|
7
|
+
import { getComments, resolveErrorNames, wrapWithMaybeRefOrGetter } from '../utils.ts'
|
|
8
|
+
import { buildQueryKeyParamsNode } from './QueryKey.tsx'
|
|
9
|
+
import { getQueryOptionsParams } from './QueryOptions.tsx'
|
|
9
10
|
|
|
10
11
|
type Props = {
|
|
11
|
-
/**
|
|
12
|
-
* Name of the function
|
|
13
|
-
*/
|
|
14
12
|
name: string
|
|
15
13
|
queryOptionsName: string
|
|
16
14
|
queryKeyName: string
|
|
17
15
|
queryKeyTypeName: string
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
node: ast.OperationNode
|
|
17
|
+
tsResolver: ResolverTs
|
|
20
18
|
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']
|
|
21
19
|
paramsType: PluginVueQuery['resolvedOptions']['paramsType']
|
|
22
20
|
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']
|
|
23
21
|
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']
|
|
22
|
+
initialPageParam: Infinite['initialPageParam']
|
|
23
|
+
queryParam?: Infinite['queryParam']
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
paramsType: PluginVueQuery['resolvedOptions']['paramsType']
|
|
29
|
-
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']
|
|
30
|
-
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']
|
|
31
|
-
typeSchemas: OperationSchemas
|
|
32
|
-
}
|
|
26
|
+
const declarationPrinter = functionPrinter({ mode: 'declaration' })
|
|
27
|
+
const callPrinter = functionPrinter({ mode: 'call' })
|
|
33
28
|
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
params: typeSchemas.queryParams?.name
|
|
58
|
-
? {
|
|
59
|
-
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
60
|
-
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
61
|
-
}
|
|
62
|
-
: undefined,
|
|
63
|
-
headers: typeSchemas.headerParams?.name
|
|
64
|
-
? {
|
|
65
|
-
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
66
|
-
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
67
|
-
}
|
|
68
|
-
: undefined,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Check if all children are optional or undefined
|
|
72
|
-
const allChildrenAreOptional = Object.values(children).every((child) => !child || child.optional)
|
|
73
|
-
|
|
74
|
-
return FunctionParams.factory({
|
|
75
|
-
data: {
|
|
76
|
-
mode: 'object',
|
|
77
|
-
children,
|
|
78
|
-
default: allChildrenAreOptional ? '{}' : undefined,
|
|
79
|
-
},
|
|
80
|
-
options: {
|
|
81
|
-
type: `
|
|
82
|
-
{
|
|
83
|
-
query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },
|
|
84
|
-
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}
|
|
85
|
-
}
|
|
86
|
-
`,
|
|
87
|
-
default: '{}',
|
|
88
|
-
},
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return FunctionParams.factory({
|
|
93
|
-
pathParams: typeSchemas.pathParams?.name
|
|
94
|
-
? {
|
|
95
|
-
mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
|
|
96
|
-
children: getPathParams(typeSchemas.pathParams, {
|
|
97
|
-
typed: true,
|
|
98
|
-
casing: paramsCasing,
|
|
99
|
-
override(item) {
|
|
100
|
-
return {
|
|
101
|
-
...item,
|
|
102
|
-
type: `MaybeRefOrGetter<${item.type}>`,
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
}),
|
|
106
|
-
default: getDefaultValue(typeSchemas.pathParams?.schema),
|
|
107
|
-
}
|
|
108
|
-
: undefined,
|
|
109
|
-
data: typeSchemas.request?.name
|
|
110
|
-
? {
|
|
111
|
-
type: `MaybeRefOrGetter<${typeSchemas.request?.name}>`,
|
|
112
|
-
optional: isOptional(typeSchemas.request?.schema),
|
|
113
|
-
}
|
|
114
|
-
: undefined,
|
|
115
|
-
params: typeSchemas.queryParams?.name
|
|
116
|
-
? {
|
|
117
|
-
type: `MaybeRefOrGetter<${typeSchemas.queryParams?.name}>`,
|
|
118
|
-
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
119
|
-
}
|
|
120
|
-
: undefined,
|
|
121
|
-
headers: typeSchemas.headerParams?.name
|
|
122
|
-
? {
|
|
123
|
-
type: `MaybeRefOrGetter<${typeSchemas.headerParams?.name}>`,
|
|
124
|
-
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
125
|
-
}
|
|
126
|
-
: undefined,
|
|
127
|
-
options: {
|
|
128
|
-
type: `
|
|
129
|
-
{
|
|
29
|
+
function buildInfiniteQueryParamsNode(
|
|
30
|
+
node: ast.OperationNode,
|
|
31
|
+
options: {
|
|
32
|
+
paramsType: PluginVueQuery['resolvedOptions']['paramsType']
|
|
33
|
+
paramsCasing: PluginVueQuery['resolvedOptions']['paramsCasing']
|
|
34
|
+
pathParamsType: PluginVueQuery['resolvedOptions']['pathParamsType']
|
|
35
|
+
dataReturnType: PluginVueQuery['resolvedOptions']['client']['dataReturnType']
|
|
36
|
+
resolver: ResolverTs
|
|
37
|
+
},
|
|
38
|
+
): ast.FunctionParametersNode {
|
|
39
|
+
const { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver } = options
|
|
40
|
+
const responseName = resolver.resolveResponseName(node)
|
|
41
|
+
const requestName = node.requestBody?.content?.[0]?.schema ? resolver.resolveDataName(node) : undefined
|
|
42
|
+
const errorNames = resolveErrorNames(node, resolver)
|
|
43
|
+
|
|
44
|
+
const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`
|
|
45
|
+
const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`
|
|
46
|
+
|
|
47
|
+
const optionsParam = ast.createFunctionParameter({
|
|
48
|
+
name: 'options',
|
|
49
|
+
type: ast.createParamsType({
|
|
50
|
+
variant: 'reference',
|
|
51
|
+
name: `{
|
|
130
52
|
query?: Partial<UseInfiniteQueryOptions<${[TData, TError, 'TQueryData', 'TQueryKey', 'TQueryData'].join(', ')}>> & { client?: QueryClient },
|
|
131
|
-
client?: ${
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
53
|
+
client?: ${requestName ? `Partial<RequestConfig<${requestName}>> & { client?: Client }` : 'Partial<RequestConfig> & { client?: Client }'}
|
|
54
|
+
}`,
|
|
55
|
+
}),
|
|
56
|
+
default: '{}',
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const baseParams = ast.createOperationParams(node, {
|
|
60
|
+
paramsType,
|
|
61
|
+
pathParamsType: paramsType === 'object' ? 'object' : pathParamsType === 'object' ? 'object' : 'inline',
|
|
62
|
+
paramsCasing,
|
|
63
|
+
resolver,
|
|
64
|
+
extraParams: [optionsParam],
|
|
136
65
|
})
|
|
66
|
+
|
|
67
|
+
return wrapWithMaybeRefOrGetter(baseParams, (name) => name === 'options')
|
|
137
68
|
}
|
|
138
69
|
|
|
139
70
|
export function InfiniteQuery({
|
|
@@ -142,56 +73,39 @@ export function InfiniteQuery({
|
|
|
142
73
|
queryOptionsName,
|
|
143
74
|
queryKeyName,
|
|
144
75
|
paramsType,
|
|
145
|
-
pathParamsType,
|
|
146
76
|
paramsCasing,
|
|
77
|
+
pathParamsType,
|
|
147
78
|
dataReturnType,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}: Props):
|
|
151
|
-
const
|
|
152
|
-
const
|
|
79
|
+
node,
|
|
80
|
+
tsResolver,
|
|
81
|
+
}: Props): KubbReactNode {
|
|
82
|
+
const responseName = tsResolver.resolveResponseName(node)
|
|
83
|
+
const errorNames = resolveErrorNames(node, tsResolver)
|
|
84
|
+
|
|
85
|
+
const TData = dataReturnType === 'data' ? responseName : `ResponseConfig<${responseName}>`
|
|
86
|
+
const TError = `ResponseErrorConfig<${errorNames.length > 0 ? errorNames.join(' | ') : 'Error'}>`
|
|
153
87
|
const returnType = `UseInfiniteQueryReturnType<${['TData', TError].join(', ')}> & { queryKey: TQueryKey }`
|
|
154
88
|
const generics = [`TData = InfiniteData<${TData}>`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
|
|
155
89
|
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const queryOptionsParams = QueryOptions.getParams({
|
|
162
|
-
paramsType,
|
|
163
|
-
pathParamsType,
|
|
164
|
-
typeSchemas,
|
|
165
|
-
paramsCasing,
|
|
166
|
-
})
|
|
167
|
-
const params = getParams({
|
|
168
|
-
paramsCasing,
|
|
169
|
-
paramsType,
|
|
170
|
-
pathParamsType,
|
|
171
|
-
dataReturnType,
|
|
172
|
-
typeSchemas,
|
|
173
|
-
})
|
|
90
|
+
const queryKeyParamsNode = buildQueryKeyParamsNode(node, { pathParamsType, paramsCasing, resolver: tsResolver })
|
|
91
|
+
const queryKeyParamsCall = callPrinter.print(queryKeyParamsNode) ?? ''
|
|
92
|
+
|
|
93
|
+
const queryOptionsParamsNode = getQueryOptionsParams(node, { paramsType, paramsCasing, pathParamsType, resolver: tsResolver })
|
|
94
|
+
const queryOptionsParamsCall = callPrinter.print(queryOptionsParamsNode) ?? ''
|
|
174
95
|
|
|
175
|
-
const
|
|
96
|
+
const paramsNode = buildInfiniteQueryParamsNode(node, { paramsType, paramsCasing, pathParamsType, dataReturnType, resolver: tsResolver })
|
|
97
|
+
const paramsSignature = declarationPrinter.print(paramsNode) ?? ''
|
|
176
98
|
|
|
177
99
|
return (
|
|
178
100
|
<File.Source name={name} isExportable isIndexable>
|
|
179
|
-
<Function
|
|
180
|
-
name={name}
|
|
181
|
-
export
|
|
182
|
-
generics={generics.join(', ')}
|
|
183
|
-
params={params.toConstructor()}
|
|
184
|
-
JSDoc={{
|
|
185
|
-
comments: getComments(operation),
|
|
186
|
-
}}
|
|
187
|
-
>
|
|
101
|
+
<Function name={name} export generics={generics.join(', ')} params={paramsSignature} JSDoc={{ comments: getComments(node) }}>
|
|
188
102
|
{`
|
|
189
103
|
const { query: queryConfig = {}, client: config = {} } = options ?? {}
|
|
190
104
|
const { client: queryClient, ...resolvedOptions } = queryConfig
|
|
191
|
-
const queryKey = (resolvedOptions && 'queryKey' in resolvedOptions ? toValue(resolvedOptions.queryKey) : undefined) ?? ${queryKeyName}(${
|
|
105
|
+
const queryKey = (resolvedOptions && 'queryKey' in resolvedOptions ? toValue(resolvedOptions.queryKey) : undefined) ?? ${queryKeyName}(${queryKeyParamsCall})
|
|
192
106
|
|
|
193
107
|
const query = useInfiniteQuery({
|
|
194
|
-
...${
|
|
108
|
+
...${queryOptionsName}(${queryOptionsParamsCall}),
|
|
195
109
|
...resolvedOptions,
|
|
196
110
|
queryKey
|
|
197
111
|
} as unknown as UseInfiniteQueryOptions<${TData}, ${TError}, ${TData}, TQueryKey, ${TData}>, toValue(queryClient)) as ${returnType}
|
|
@@ -204,5 +118,3 @@ export function InfiniteQuery({
|
|
|
204
118
|
</File.Source>
|
|
205
119
|
)
|
|
206
120
|
}
|
|
207
|
-
|
|
208
|
-
InfiniteQuery.getParams = getParams
|