@kubb/plugin-react-query 3.0.0-alpha.9 → 3.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/README.md +14 -5
- package/dist/chunk-24SL7I66.cjs +683 -0
- package/dist/chunk-24SL7I66.cjs.map +1 -0
- package/dist/chunk-BML6BZ4F.cjs +878 -0
- package/dist/chunk-BML6BZ4F.cjs.map +1 -0
- package/dist/chunk-JFIGHRBM.js +867 -0
- package/dist/chunk-JFIGHRBM.js.map +1 -0
- package/dist/chunk-LBVGJA4Q.js +674 -0
- package/dist/chunk-LBVGJA4Q.js.map +1 -0
- package/dist/components.cjs +39 -12
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +172 -6
- package/dist/components.d.ts +172 -6
- package/dist/components.js +2 -12
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +25 -0
- package/dist/generators.cjs.map +1 -0
- package/dist/generators.d.cts +14 -0
- package/dist/generators.d.ts +14 -0
- package/dist/generators.js +4 -0
- package/dist/generators.js.map +1 -0
- package/dist/index.cjs +80 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +63 -120
- package/dist/index.js.map +1 -1
- package/dist/types-Dlwxp28D.d.cts +230 -0
- package/dist/types-Dlwxp28D.d.ts +230 -0
- package/package.json +22 -17
- package/src/components/InfiniteQuery.tsx +176 -0
- package/src/components/InfiniteQueryOptions.tsx +185 -0
- package/src/components/Mutation.tsx +142 -320
- package/src/components/MutationKey.tsx +48 -0
- package/src/components/Query.tsx +145 -592
- package/src/components/QueryKey.tsx +51 -182
- package/src/components/QueryOptions.tsx +110 -472
- package/src/components/SuspenseQuery.tsx +176 -0
- package/src/components/index.ts +4 -0
- package/src/generators/__snapshots__/clientDataReturnTypeFull.ts +51 -0
- package/src/generators/__snapshots__/clientGetImportPath.ts +51 -0
- package/src/generators/__snapshots__/clientPostImportPath.ts +44 -0
- package/src/generators/__snapshots__/findByTags.ts +51 -0
- package/src/generators/__snapshots__/findByTagsObject.ts +60 -0
- package/src/generators/__snapshots__/findByTagsPathParamsObject.ts +51 -0
- package/src/generators/__snapshots__/findByTagsWithCustomQueryKey.ts +51 -0
- package/src/generators/__snapshots__/findByTagsWithZod.ts +51 -0
- package/src/generators/__snapshots__/findInfiniteByTags.ts +57 -0
- package/src/generators/__snapshots__/findInfiniteByTagsCursor.ts +57 -0
- package/src/generators/__snapshots__/getAsMutation.ts +31 -0
- package/src/generators/__snapshots__/postAsQuery.ts +50 -0
- package/src/generators/__snapshots__/updatePetById.ts +44 -0
- package/src/generators/__snapshots__/updatePetByIdPathParamsObject.ts +44 -0
- package/src/generators/index.ts +4 -0
- package/src/generators/infiniteQueryGenerator.tsx +126 -0
- package/src/generators/mutationGenerator.tsx +109 -0
- package/src/generators/queryGenerator.tsx +123 -0
- package/src/generators/suspenseQueryGenerator.tsx +123 -0
- package/src/plugin.ts +62 -76
- package/src/types.ts +49 -126
- package/dist/chunk-7ZODZVKP.cjs +0 -1470
- package/dist/chunk-7ZODZVKP.cjs.map +0 -1
- package/dist/chunk-ZYTZV43V.js +0 -1470
- package/dist/chunk-ZYTZV43V.js.map +0 -1
- package/dist/index-5kpkk-7M.d.cts +0 -545
- package/dist/index-5kpkk-7M.d.ts +0 -545
- package/src/OperationGenerator.tsx +0 -57
- package/src/__snapshots__/mutateAsQuery/updatePetWithForm.ts +0 -69
- package/src/__snapshots__/pathParamsTypeInline/getPetById.ts +0 -62
- package/src/__snapshots__/pathParamsTypeObject/getPetById.ts +0 -68
- package/src/__snapshots__/queryOptions/getPetById.ts +0 -41
- package/src/__snapshots__/queryWithoutQueryOptions/getPetById.ts +0 -51
- package/src/__snapshots__/variablesTypeMutate/deletePet.ts +0 -24
- package/src/components/QueryImports.tsx +0 -167
- package/src/components/SchemaType.tsx +0 -59
- package/src/components/__snapshots__/gen/showPetById.ts +0 -67
- package/src/components/__snapshots__/gen/useCreatePets.ts +0 -46
- package/src/components/__snapshots__/gen/useCreatePetsMutate.ts +0 -46
- package/src/utils.ts +0 -96
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { File, Function, FunctionParams } from '@kubb/react'
|
|
2
|
+
|
|
3
|
+
import { type Operation, isOptional } from '@kubb/oas'
|
|
4
|
+
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
5
|
+
import { getComments, getPathParams } from '@kubb/plugin-oas/utils'
|
|
6
|
+
import type { ReactNode } from 'react'
|
|
7
|
+
import type { PluginReactQuery } from '../types.ts'
|
|
8
|
+
import { QueryKey } from './QueryKey.tsx'
|
|
9
|
+
import { QueryOptions } from './QueryOptions.tsx'
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
/**
|
|
13
|
+
* Name of the function
|
|
14
|
+
*/
|
|
15
|
+
name: string
|
|
16
|
+
queryOptionsName: string
|
|
17
|
+
queryKeyName: string
|
|
18
|
+
queryKeyTypeName: string
|
|
19
|
+
typeSchemas: OperationSchemas
|
|
20
|
+
operation: Operation
|
|
21
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType']
|
|
22
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']
|
|
23
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type GetParamsProps = {
|
|
27
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType']
|
|
28
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']
|
|
29
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']
|
|
30
|
+
typeSchemas: OperationSchemas
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getParams({ paramsType, pathParamsType, dataReturnType, typeSchemas }: GetParamsProps) {
|
|
34
|
+
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
35
|
+
|
|
36
|
+
if (paramsType === 'object') {
|
|
37
|
+
return FunctionParams.factory({
|
|
38
|
+
data: {
|
|
39
|
+
mode: 'object',
|
|
40
|
+
children: {
|
|
41
|
+
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
42
|
+
data: typeSchemas.request?.name
|
|
43
|
+
? {
|
|
44
|
+
type: typeSchemas.request?.name,
|
|
45
|
+
optional: isOptional(typeSchemas.request?.schema),
|
|
46
|
+
}
|
|
47
|
+
: undefined,
|
|
48
|
+
params: typeSchemas.queryParams?.name
|
|
49
|
+
? {
|
|
50
|
+
type: typeSchemas.queryParams?.name,
|
|
51
|
+
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
52
|
+
}
|
|
53
|
+
: undefined,
|
|
54
|
+
headers: typeSchemas.headerParams?.name
|
|
55
|
+
? {
|
|
56
|
+
type: typeSchemas.headerParams?.name,
|
|
57
|
+
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
options: {
|
|
63
|
+
type: `
|
|
64
|
+
{
|
|
65
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
66
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
67
|
+
}
|
|
68
|
+
`,
|
|
69
|
+
default: '{}',
|
|
70
|
+
},
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return FunctionParams.factory({
|
|
75
|
+
pathParams: typeSchemas.pathParams?.name
|
|
76
|
+
? {
|
|
77
|
+
mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
|
|
78
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
79
|
+
type: typeSchemas.pathParams?.name,
|
|
80
|
+
optional: isOptional(typeSchemas.pathParams?.schema),
|
|
81
|
+
}
|
|
82
|
+
: undefined,
|
|
83
|
+
data: typeSchemas.request?.name
|
|
84
|
+
? {
|
|
85
|
+
type: typeSchemas.request?.name,
|
|
86
|
+
optional: isOptional(typeSchemas.request?.schema),
|
|
87
|
+
}
|
|
88
|
+
: undefined,
|
|
89
|
+
params: typeSchemas.queryParams?.name
|
|
90
|
+
? {
|
|
91
|
+
type: typeSchemas.queryParams?.name,
|
|
92
|
+
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
93
|
+
}
|
|
94
|
+
: undefined,
|
|
95
|
+
headers: typeSchemas.headerParams?.name
|
|
96
|
+
? {
|
|
97
|
+
type: typeSchemas.headerParams?.name,
|
|
98
|
+
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
99
|
+
}
|
|
100
|
+
: undefined,
|
|
101
|
+
options: {
|
|
102
|
+
type: `
|
|
103
|
+
{
|
|
104
|
+
query?: Partial<InfiniteQueryObserverOptions<${[TData, typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error', 'TData', 'TQueryData', 'TQueryKey'].join(', ')}>>,
|
|
105
|
+
client?: ${typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>'}
|
|
106
|
+
}
|
|
107
|
+
`,
|
|
108
|
+
default: '{}',
|
|
109
|
+
},
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function InfiniteQuery({
|
|
114
|
+
name,
|
|
115
|
+
queryKeyTypeName,
|
|
116
|
+
queryOptionsName,
|
|
117
|
+
queryKeyName,
|
|
118
|
+
paramsType,
|
|
119
|
+
pathParamsType,
|
|
120
|
+
dataReturnType,
|
|
121
|
+
typeSchemas,
|
|
122
|
+
operation,
|
|
123
|
+
}: Props): ReactNode {
|
|
124
|
+
const TData = dataReturnType === 'data' ? typeSchemas.response.name : `ResponseConfig<${typeSchemas.response.name}>`
|
|
125
|
+
const returnType = `UseInfiniteQueryResult<${['TData', typeSchemas.errors?.map((item) => item.name).join(' | ') || 'Error'].join(', ')}> & { queryKey: TQueryKey }`
|
|
126
|
+
const generics = [`TData = ${TData}`, `TQueryData = ${TData}`, `TQueryKey extends QueryKey = ${queryKeyTypeName}`]
|
|
127
|
+
|
|
128
|
+
const queryKeyParams = QueryKey.getParams({
|
|
129
|
+
pathParamsType,
|
|
130
|
+
typeSchemas,
|
|
131
|
+
})
|
|
132
|
+
const queryOptionsParams = QueryOptions.getParams({
|
|
133
|
+
paramsType,
|
|
134
|
+
pathParamsType,
|
|
135
|
+
typeSchemas,
|
|
136
|
+
})
|
|
137
|
+
const params = getParams({
|
|
138
|
+
paramsType,
|
|
139
|
+
pathParamsType,
|
|
140
|
+
dataReturnType,
|
|
141
|
+
typeSchemas,
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const queryOptions = `${queryOptionsName}(${queryOptionsParams.toCall()}) as unknown as InfiniteQueryObserverOptions`
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<File.Source name={name} isExportable isIndexable>
|
|
148
|
+
<Function
|
|
149
|
+
name={name}
|
|
150
|
+
export
|
|
151
|
+
generics={generics.join(', ')}
|
|
152
|
+
params={params.toConstructor()}
|
|
153
|
+
JSDoc={{
|
|
154
|
+
comments: getComments(operation),
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
{`
|
|
158
|
+
const { query: queryOptions, client: config = {} } = options ?? {}
|
|
159
|
+
const queryKey = queryOptions?.queryKey ?? ${queryKeyName}(${queryKeyParams.toCall()})
|
|
160
|
+
|
|
161
|
+
const query = useInfiniteQuery({
|
|
162
|
+
...${queryOptions},
|
|
163
|
+
queryKey,
|
|
164
|
+
...queryOptions as unknown as Omit<InfiniteQueryObserverOptions, "queryKey">
|
|
165
|
+
}) as ${returnType}
|
|
166
|
+
|
|
167
|
+
query.queryKey = queryKey as TQueryKey
|
|
168
|
+
|
|
169
|
+
return query
|
|
170
|
+
`}
|
|
171
|
+
</Function>
|
|
172
|
+
</File.Source>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
InfiniteQuery.getParams = getParams
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { getPathParams } from '@kubb/plugin-oas/utils'
|
|
2
|
+
import { File, Function, FunctionParams } from '@kubb/react'
|
|
3
|
+
|
|
4
|
+
import type { ReactNode } from 'react'
|
|
5
|
+
|
|
6
|
+
import { isOptional } from '@kubb/oas'
|
|
7
|
+
import { Client } from '@kubb/plugin-client/components'
|
|
8
|
+
import type { OperationSchemas } from '@kubb/plugin-oas'
|
|
9
|
+
import type { Infinite, PluginReactQuery } from '../types.ts'
|
|
10
|
+
import { QueryKey } from './QueryKey.tsx'
|
|
11
|
+
|
|
12
|
+
type Props = {
|
|
13
|
+
name: string
|
|
14
|
+
clientName: string
|
|
15
|
+
queryKeyName: string
|
|
16
|
+
typeSchemas: OperationSchemas
|
|
17
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType']
|
|
18
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']
|
|
19
|
+
dataReturnType: PluginReactQuery['resolvedOptions']['client']['dataReturnType']
|
|
20
|
+
initialPageParam: Infinite['initialPageParam']
|
|
21
|
+
cursorParam: Infinite['cursorParam']
|
|
22
|
+
queryParam: Infinite['queryParam']
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type GetParamsProps = {
|
|
26
|
+
paramsType: PluginReactQuery['resolvedOptions']['paramsType']
|
|
27
|
+
pathParamsType: PluginReactQuery['resolvedOptions']['pathParamsType']
|
|
28
|
+
typeSchemas: OperationSchemas
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getParams({ paramsType, pathParamsType, typeSchemas }: GetParamsProps) {
|
|
32
|
+
if (paramsType === 'object') {
|
|
33
|
+
return FunctionParams.factory({
|
|
34
|
+
data: {
|
|
35
|
+
mode: 'object',
|
|
36
|
+
children: {
|
|
37
|
+
...getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
38
|
+
data: typeSchemas.request?.name
|
|
39
|
+
? {
|
|
40
|
+
type: typeSchemas.request?.name,
|
|
41
|
+
optional: isOptional(typeSchemas.request?.schema),
|
|
42
|
+
}
|
|
43
|
+
: undefined,
|
|
44
|
+
params: typeSchemas.queryParams?.name
|
|
45
|
+
? {
|
|
46
|
+
type: typeSchemas.queryParams?.name,
|
|
47
|
+
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
48
|
+
}
|
|
49
|
+
: undefined,
|
|
50
|
+
headers: typeSchemas.headerParams?.name
|
|
51
|
+
? {
|
|
52
|
+
type: typeSchemas.headerParams?.name,
|
|
53
|
+
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
54
|
+
}
|
|
55
|
+
: undefined,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
config: {
|
|
59
|
+
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>',
|
|
60
|
+
default: '{}',
|
|
61
|
+
},
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return FunctionParams.factory({
|
|
66
|
+
pathParams: typeSchemas.pathParams?.name
|
|
67
|
+
? {
|
|
68
|
+
mode: pathParamsType === 'object' ? 'object' : 'inlineSpread',
|
|
69
|
+
children: getPathParams(typeSchemas.pathParams, { typed: true }),
|
|
70
|
+
type: typeSchemas.pathParams?.name,
|
|
71
|
+
optional: isOptional(typeSchemas.pathParams?.schema),
|
|
72
|
+
}
|
|
73
|
+
: undefined,
|
|
74
|
+
data: typeSchemas.request?.name
|
|
75
|
+
? {
|
|
76
|
+
type: typeSchemas.request?.name,
|
|
77
|
+
optional: isOptional(typeSchemas.request?.schema),
|
|
78
|
+
}
|
|
79
|
+
: undefined,
|
|
80
|
+
params: typeSchemas.queryParams?.name
|
|
81
|
+
? {
|
|
82
|
+
type: typeSchemas.queryParams?.name,
|
|
83
|
+
optional: isOptional(typeSchemas.queryParams?.schema),
|
|
84
|
+
}
|
|
85
|
+
: undefined,
|
|
86
|
+
headers: typeSchemas.headerParams?.name
|
|
87
|
+
? {
|
|
88
|
+
type: typeSchemas.headerParams?.name,
|
|
89
|
+
optional: isOptional(typeSchemas.headerParams?.schema),
|
|
90
|
+
}
|
|
91
|
+
: undefined,
|
|
92
|
+
config: {
|
|
93
|
+
type: typeSchemas.request?.name ? `Partial<RequestConfig<${typeSchemas.request?.name}>>` : 'Partial<RequestConfig>',
|
|
94
|
+
default: '{}',
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function InfiniteQueryOptions({
|
|
100
|
+
name,
|
|
101
|
+
clientName,
|
|
102
|
+
initialPageParam,
|
|
103
|
+
cursorParam,
|
|
104
|
+
typeSchemas,
|
|
105
|
+
paramsType,
|
|
106
|
+
dataReturnType,
|
|
107
|
+
pathParamsType,
|
|
108
|
+
queryParam,
|
|
109
|
+
queryKeyName,
|
|
110
|
+
}: Props): ReactNode {
|
|
111
|
+
const params = getParams({ paramsType, pathParamsType, typeSchemas })
|
|
112
|
+
const clientParams = Client.getParams({
|
|
113
|
+
typeSchemas,
|
|
114
|
+
paramsType,
|
|
115
|
+
pathParamsType,
|
|
116
|
+
})
|
|
117
|
+
const queryKeyParams = QueryKey.getParams({
|
|
118
|
+
pathParamsType,
|
|
119
|
+
typeSchemas,
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
const queryOptions = [
|
|
123
|
+
`initialPageParam: ${typeof initialPageParam === 'string' ? JSON.stringify(initialPageParam) : initialPageParam}`,
|
|
124
|
+
cursorParam ? `getNextPageParam: (lastPage) => lastPage['${cursorParam}']` : undefined,
|
|
125
|
+
cursorParam ? `getPreviousPageParam: (firstPage) => firstPage['${cursorParam}']` : undefined,
|
|
126
|
+
!cursorParam && dataReturnType === 'full'
|
|
127
|
+
? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage.data) && lastPage.data.length === 0 ? undefined : lastPageParam + 1'
|
|
128
|
+
: undefined,
|
|
129
|
+
!cursorParam && dataReturnType === 'data'
|
|
130
|
+
? 'getNextPageParam: (lastPage, _allPages, lastPageParam) => Array.isArray(lastPage) && lastPage.length === 0 ? undefined : lastPageParam + 1'
|
|
131
|
+
: undefined,
|
|
132
|
+
!cursorParam ? 'getPreviousPageParam: (_firstPage, _allPages, firstPageParam) => firstPageParam <= 1 ? undefined : firstPageParam - 1' : undefined,
|
|
133
|
+
].filter(Boolean)
|
|
134
|
+
|
|
135
|
+
const infiniteOverrideParams =
|
|
136
|
+
queryParam && typeSchemas.queryParams?.name
|
|
137
|
+
? `
|
|
138
|
+
if(params) {
|
|
139
|
+
params['${queryParam}'] = pageParam as unknown as ${typeSchemas.queryParams?.name}['${queryParam}']
|
|
140
|
+
}`
|
|
141
|
+
: ''
|
|
142
|
+
|
|
143
|
+
const enabled = Object.entries(queryKeyParams.flatParams)
|
|
144
|
+
.map(([key, item]) => (item && !item.optional ? key : undefined))
|
|
145
|
+
.filter(Boolean)
|
|
146
|
+
.join('&& ')
|
|
147
|
+
|
|
148
|
+
const enabledText = enabled ? `enabled: !!(${enabled})` : ''
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<File.Source name={name} isExportable isIndexable>
|
|
152
|
+
<Function name={name} export params={params.toConstructor()}>
|
|
153
|
+
{infiniteOverrideParams &&
|
|
154
|
+
`
|
|
155
|
+
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
156
|
+
return infiniteQueryOptions({
|
|
157
|
+
${enabledText}
|
|
158
|
+
queryKey,
|
|
159
|
+
queryFn: async ({ signal, pageParam }) => {
|
|
160
|
+
config.signal = signal
|
|
161
|
+
${infiniteOverrideParams}
|
|
162
|
+
return ${clientName}(${clientParams.toCall()})
|
|
163
|
+
},
|
|
164
|
+
${queryOptions.join('\n')}
|
|
165
|
+
})
|
|
166
|
+
`}
|
|
167
|
+
{!infiniteOverrideParams &&
|
|
168
|
+
`
|
|
169
|
+
const queryKey = ${queryKeyName}(${queryKeyParams.toCall()})
|
|
170
|
+
return infiniteQueryOptions({
|
|
171
|
+
${enabledText}
|
|
172
|
+
queryKey,
|
|
173
|
+
queryFn: async ({ signal }) => {
|
|
174
|
+
config.signal = signal
|
|
175
|
+
return ${clientName}(${clientParams.toCall()})
|
|
176
|
+
},
|
|
177
|
+
${queryOptions.join('\n')}
|
|
178
|
+
})
|
|
179
|
+
`}
|
|
180
|
+
</Function>
|
|
181
|
+
</File.Source>
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
InfiniteQueryOptions.getParams = getParams
|