@zenstackhq/tanstack-query 2.9.4 → 2.10.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zenstackhq/tanstack-query",
3
3
  "displayName": "ZenStack plugin for generating tanstack-query hooks",
4
- "version": "2.9.4",
4
+ "version": "2.10.1",
5
5
  "description": "ZenStack plugin for generating tanstack-query hooks",
6
6
  "main": "index.js",
7
7
  "exports": {
@@ -79,8 +79,8 @@
79
79
  "ts-morph": "^16.0.0",
80
80
  "ts-pattern": "^4.3.0",
81
81
  "upper-case-first": "^2.0.2",
82
- "@zenstackhq/sdk": "2.9.4",
83
- "@zenstackhq/runtime": "2.9.4"
82
+ "@zenstackhq/runtime": "2.10.1",
83
+ "@zenstackhq/sdk": "2.10.1"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@tanstack/react-query": "^4.29.7",
@@ -101,7 +101,7 @@
101
101
  "swr": "^2.0.3",
102
102
  "tmp": "^0.2.3",
103
103
  "vue": "^3.3.4",
104
- "@zenstackhq/testtools": "2.9.4"
104
+ "@zenstackhq/testtools": "2.10.1"
105
105
  },
106
106
  "scripts": {
107
107
  "clean": "rimraf dist",
@@ -30,7 +30,127 @@ declare function getHooksContext(): {
30
30
  * @param fetch The fetch function to use for sending the HTTP request
31
31
  * @returns useQuery hook
32
32
  */
33
- declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): _tanstack_react_query.UseQueryResult<TData, TError>;
33
+ declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): {
34
+ data: TData;
35
+ error: TError;
36
+ isError: true;
37
+ isLoading: false;
38
+ isLoadingError: false;
39
+ isRefetchError: true;
40
+ isSuccess: false;
41
+ status: "error";
42
+ dataUpdatedAt: number;
43
+ errorUpdatedAt: number;
44
+ failureCount: number;
45
+ failureReason: TError | null;
46
+ errorUpdateCount: number;
47
+ isFetched: boolean;
48
+ isFetchedAfterMount: boolean;
49
+ isFetching: boolean;
50
+ isInitialLoading: boolean;
51
+ isPaused: boolean;
52
+ isPlaceholderData: boolean;
53
+ isPreviousData: boolean;
54
+ isRefetching: boolean;
55
+ isStale: boolean;
56
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
57
+ remove: () => void;
58
+ fetchStatus: _tanstack_react_query.FetchStatus;
59
+ queryKey: [string, string, string, unknown, {
60
+ infinite: boolean;
61
+ optimisticUpdate: boolean;
62
+ }];
63
+ } | {
64
+ data: TData;
65
+ error: null;
66
+ isError: false;
67
+ isLoading: false;
68
+ isLoadingError: false;
69
+ isRefetchError: false;
70
+ isSuccess: true;
71
+ status: "success";
72
+ dataUpdatedAt: number;
73
+ errorUpdatedAt: number;
74
+ failureCount: number;
75
+ failureReason: TError | null;
76
+ errorUpdateCount: number;
77
+ isFetched: boolean;
78
+ isFetchedAfterMount: boolean;
79
+ isFetching: boolean;
80
+ isInitialLoading: boolean;
81
+ isPaused: boolean;
82
+ isPlaceholderData: boolean;
83
+ isPreviousData: boolean;
84
+ isRefetching: boolean;
85
+ isStale: boolean;
86
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
87
+ remove: () => void;
88
+ fetchStatus: _tanstack_react_query.FetchStatus;
89
+ queryKey: [string, string, string, unknown, {
90
+ infinite: boolean;
91
+ optimisticUpdate: boolean;
92
+ }];
93
+ } | {
94
+ data: undefined;
95
+ error: TError;
96
+ isError: true;
97
+ isLoading: false;
98
+ isLoadingError: true;
99
+ isRefetchError: false;
100
+ isSuccess: false;
101
+ status: "error";
102
+ dataUpdatedAt: number;
103
+ errorUpdatedAt: number;
104
+ failureCount: number;
105
+ failureReason: TError | null;
106
+ errorUpdateCount: number;
107
+ isFetched: boolean;
108
+ isFetchedAfterMount: boolean;
109
+ isFetching: boolean;
110
+ isInitialLoading: boolean;
111
+ isPaused: boolean;
112
+ isPlaceholderData: boolean;
113
+ isPreviousData: boolean;
114
+ isRefetching: boolean;
115
+ isStale: boolean;
116
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
117
+ remove: () => void;
118
+ fetchStatus: _tanstack_react_query.FetchStatus;
119
+ queryKey: [string, string, string, unknown, {
120
+ infinite: boolean;
121
+ optimisticUpdate: boolean;
122
+ }];
123
+ } | {
124
+ data: undefined;
125
+ error: null;
126
+ isError: false;
127
+ isLoading: true;
128
+ isLoadingError: false;
129
+ isRefetchError: false;
130
+ isSuccess: false;
131
+ status: "loading";
132
+ dataUpdatedAt: number;
133
+ errorUpdatedAt: number;
134
+ failureCount: number;
135
+ failureReason: TError | null;
136
+ errorUpdateCount: number;
137
+ isFetched: boolean;
138
+ isFetchedAfterMount: boolean;
139
+ isFetching: boolean;
140
+ isInitialLoading: boolean;
141
+ isPaused: boolean;
142
+ isPlaceholderData: boolean;
143
+ isPreviousData: boolean;
144
+ isRefetching: boolean;
145
+ isStale: boolean;
146
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
147
+ remove: () => void;
148
+ fetchStatus: _tanstack_react_query.FetchStatus;
149
+ queryKey: [string, string, string, unknown, {
150
+ infinite: boolean;
151
+ optimisticUpdate: boolean;
152
+ }];
153
+ };
34
154
  /**
35
155
  * Creates a react-query infinite query.
36
156
  *
@@ -41,7 +161,151 @@ declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url:
41
161
  * @param fetch The fetch function to use for sending the HTTP request
42
162
  * @returns useInfiniteQuery hook
43
163
  */
44
- declare function useInfiniteModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData>, 'queryKey'>, fetch?: FetchFn): _tanstack_react_query.UseInfiniteQueryResult<TData, TError>;
164
+ declare function useInfiniteModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData>, 'queryKey'>, fetch?: FetchFn): {
165
+ data: undefined;
166
+ error: TError;
167
+ isError: true;
168
+ isLoading: false;
169
+ isLoadingError: true;
170
+ isRefetchError: false;
171
+ isSuccess: false;
172
+ status: "error";
173
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
174
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
175
+ hasNextPage?: boolean;
176
+ hasPreviousPage?: boolean;
177
+ isFetchingNextPage: boolean;
178
+ isFetchingPreviousPage: boolean;
179
+ dataUpdatedAt: number;
180
+ errorUpdatedAt: number;
181
+ failureCount: number;
182
+ failureReason: TError | null;
183
+ errorUpdateCount: number;
184
+ isFetched: boolean;
185
+ isFetchedAfterMount: boolean;
186
+ isFetching: boolean;
187
+ isInitialLoading: boolean;
188
+ isPaused: boolean;
189
+ isPlaceholderData: boolean;
190
+ isPreviousData: boolean;
191
+ isRefetching: boolean;
192
+ isStale: boolean;
193
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
194
+ remove: () => void;
195
+ fetchStatus: _tanstack_react_query.FetchStatus;
196
+ queryKey: [string, string, string, unknown, {
197
+ infinite: boolean;
198
+ optimisticUpdate: boolean;
199
+ }];
200
+ } | {
201
+ data: undefined;
202
+ error: null;
203
+ isError: false;
204
+ isLoading: true;
205
+ isLoadingError: false;
206
+ isRefetchError: false;
207
+ isSuccess: false;
208
+ status: "loading";
209
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
210
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
211
+ hasNextPage?: boolean;
212
+ hasPreviousPage?: boolean;
213
+ isFetchingNextPage: boolean;
214
+ isFetchingPreviousPage: boolean;
215
+ dataUpdatedAt: number;
216
+ errorUpdatedAt: number;
217
+ failureCount: number;
218
+ failureReason: TError | null;
219
+ errorUpdateCount: number;
220
+ isFetched: boolean;
221
+ isFetchedAfterMount: boolean;
222
+ isFetching: boolean;
223
+ isInitialLoading: boolean;
224
+ isPaused: boolean;
225
+ isPlaceholderData: boolean;
226
+ isPreviousData: boolean;
227
+ isRefetching: boolean;
228
+ isStale: boolean;
229
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
230
+ remove: () => void;
231
+ fetchStatus: _tanstack_react_query.FetchStatus;
232
+ queryKey: [string, string, string, unknown, {
233
+ infinite: boolean;
234
+ optimisticUpdate: boolean;
235
+ }];
236
+ } | {
237
+ data: _tanstack_react_query.InfiniteData<TData>;
238
+ error: TError;
239
+ isError: true;
240
+ isLoading: false;
241
+ isLoadingError: false;
242
+ isRefetchError: true;
243
+ isSuccess: false;
244
+ status: "error";
245
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
246
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
247
+ hasNextPage?: boolean;
248
+ hasPreviousPage?: boolean;
249
+ isFetchingNextPage: boolean;
250
+ isFetchingPreviousPage: boolean;
251
+ dataUpdatedAt: number;
252
+ errorUpdatedAt: number;
253
+ failureCount: number;
254
+ failureReason: TError | null;
255
+ errorUpdateCount: number;
256
+ isFetched: boolean;
257
+ isFetchedAfterMount: boolean;
258
+ isFetching: boolean;
259
+ isInitialLoading: boolean;
260
+ isPaused: boolean;
261
+ isPlaceholderData: boolean;
262
+ isPreviousData: boolean;
263
+ isRefetching: boolean;
264
+ isStale: boolean;
265
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
266
+ remove: () => void;
267
+ fetchStatus: _tanstack_react_query.FetchStatus;
268
+ queryKey: [string, string, string, unknown, {
269
+ infinite: boolean;
270
+ optimisticUpdate: boolean;
271
+ }];
272
+ } | {
273
+ data: _tanstack_react_query.InfiniteData<TData>;
274
+ error: null;
275
+ isError: false;
276
+ isLoading: false;
277
+ isLoadingError: false;
278
+ isRefetchError: false;
279
+ isSuccess: true;
280
+ status: "success";
281
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
282
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
283
+ hasNextPage?: boolean;
284
+ hasPreviousPage?: boolean;
285
+ isFetchingNextPage: boolean;
286
+ isFetchingPreviousPage: boolean;
287
+ dataUpdatedAt: number;
288
+ errorUpdatedAt: number;
289
+ failureCount: number;
290
+ failureReason: TError | null;
291
+ errorUpdateCount: number;
292
+ isFetched: boolean;
293
+ isFetchedAfterMount: boolean;
294
+ isFetching: boolean;
295
+ isInitialLoading: boolean;
296
+ isPaused: boolean;
297
+ isPlaceholderData: boolean;
298
+ isPreviousData: boolean;
299
+ isRefetching: boolean;
300
+ isStale: boolean;
301
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
302
+ remove: () => void;
303
+ fetchStatus: _tanstack_react_query.FetchStatus;
304
+ queryKey: [string, string, string, unknown, {
305
+ infinite: boolean;
306
+ optimisticUpdate: boolean;
307
+ }];
308
+ };
45
309
  /**
46
310
  * Creates a mutation with react-query.
47
311
  *
@@ -30,7 +30,127 @@ declare function getHooksContext(): {
30
30
  * @param fetch The fetch function to use for sending the HTTP request
31
31
  * @returns useQuery hook
32
32
  */
33
- declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): _tanstack_react_query.UseQueryResult<TData, TError>;
33
+ declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData>, 'queryKey'> & ExtraQueryOptions, fetch?: FetchFn): {
34
+ data: TData;
35
+ error: TError;
36
+ isError: true;
37
+ isLoading: false;
38
+ isLoadingError: false;
39
+ isRefetchError: true;
40
+ isSuccess: false;
41
+ status: "error";
42
+ dataUpdatedAt: number;
43
+ errorUpdatedAt: number;
44
+ failureCount: number;
45
+ failureReason: TError | null;
46
+ errorUpdateCount: number;
47
+ isFetched: boolean;
48
+ isFetchedAfterMount: boolean;
49
+ isFetching: boolean;
50
+ isInitialLoading: boolean;
51
+ isPaused: boolean;
52
+ isPlaceholderData: boolean;
53
+ isPreviousData: boolean;
54
+ isRefetching: boolean;
55
+ isStale: boolean;
56
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
57
+ remove: () => void;
58
+ fetchStatus: _tanstack_react_query.FetchStatus;
59
+ queryKey: [string, string, string, unknown, {
60
+ infinite: boolean;
61
+ optimisticUpdate: boolean;
62
+ }];
63
+ } | {
64
+ data: TData;
65
+ error: null;
66
+ isError: false;
67
+ isLoading: false;
68
+ isLoadingError: false;
69
+ isRefetchError: false;
70
+ isSuccess: true;
71
+ status: "success";
72
+ dataUpdatedAt: number;
73
+ errorUpdatedAt: number;
74
+ failureCount: number;
75
+ failureReason: TError | null;
76
+ errorUpdateCount: number;
77
+ isFetched: boolean;
78
+ isFetchedAfterMount: boolean;
79
+ isFetching: boolean;
80
+ isInitialLoading: boolean;
81
+ isPaused: boolean;
82
+ isPlaceholderData: boolean;
83
+ isPreviousData: boolean;
84
+ isRefetching: boolean;
85
+ isStale: boolean;
86
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
87
+ remove: () => void;
88
+ fetchStatus: _tanstack_react_query.FetchStatus;
89
+ queryKey: [string, string, string, unknown, {
90
+ infinite: boolean;
91
+ optimisticUpdate: boolean;
92
+ }];
93
+ } | {
94
+ data: undefined;
95
+ error: TError;
96
+ isError: true;
97
+ isLoading: false;
98
+ isLoadingError: true;
99
+ isRefetchError: false;
100
+ isSuccess: false;
101
+ status: "error";
102
+ dataUpdatedAt: number;
103
+ errorUpdatedAt: number;
104
+ failureCount: number;
105
+ failureReason: TError | null;
106
+ errorUpdateCount: number;
107
+ isFetched: boolean;
108
+ isFetchedAfterMount: boolean;
109
+ isFetching: boolean;
110
+ isInitialLoading: boolean;
111
+ isPaused: boolean;
112
+ isPlaceholderData: boolean;
113
+ isPreviousData: boolean;
114
+ isRefetching: boolean;
115
+ isStale: boolean;
116
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
117
+ remove: () => void;
118
+ fetchStatus: _tanstack_react_query.FetchStatus;
119
+ queryKey: [string, string, string, unknown, {
120
+ infinite: boolean;
121
+ optimisticUpdate: boolean;
122
+ }];
123
+ } | {
124
+ data: undefined;
125
+ error: null;
126
+ isError: false;
127
+ isLoading: true;
128
+ isLoadingError: false;
129
+ isRefetchError: false;
130
+ isSuccess: false;
131
+ status: "loading";
132
+ dataUpdatedAt: number;
133
+ errorUpdatedAt: number;
134
+ failureCount: number;
135
+ failureReason: TError | null;
136
+ errorUpdateCount: number;
137
+ isFetched: boolean;
138
+ isFetchedAfterMount: boolean;
139
+ isFetching: boolean;
140
+ isInitialLoading: boolean;
141
+ isPaused: boolean;
142
+ isPlaceholderData: boolean;
143
+ isPreviousData: boolean;
144
+ isRefetching: boolean;
145
+ isStale: boolean;
146
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<TData, TError>>;
147
+ remove: () => void;
148
+ fetchStatus: _tanstack_react_query.FetchStatus;
149
+ queryKey: [string, string, string, unknown, {
150
+ infinite: boolean;
151
+ optimisticUpdate: boolean;
152
+ }];
153
+ };
34
154
  /**
35
155
  * Creates a react-query infinite query.
36
156
  *
@@ -41,7 +161,151 @@ declare function useModelQuery<TQueryFnData, TData, TError>(model: string, url:
41
161
  * @param fetch The fetch function to use for sending the HTTP request
42
162
  * @returns useInfiniteQuery hook
43
163
  */
44
- declare function useInfiniteModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData>, 'queryKey'>, fetch?: FetchFn): _tanstack_react_query.UseInfiniteQueryResult<TData, TError>;
164
+ declare function useInfiniteModelQuery<TQueryFnData, TData, TError>(model: string, url: string, args?: unknown, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData>, 'queryKey'>, fetch?: FetchFn): {
165
+ data: undefined;
166
+ error: TError;
167
+ isError: true;
168
+ isLoading: false;
169
+ isLoadingError: true;
170
+ isRefetchError: false;
171
+ isSuccess: false;
172
+ status: "error";
173
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
174
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
175
+ hasNextPage?: boolean;
176
+ hasPreviousPage?: boolean;
177
+ isFetchingNextPage: boolean;
178
+ isFetchingPreviousPage: boolean;
179
+ dataUpdatedAt: number;
180
+ errorUpdatedAt: number;
181
+ failureCount: number;
182
+ failureReason: TError | null;
183
+ errorUpdateCount: number;
184
+ isFetched: boolean;
185
+ isFetchedAfterMount: boolean;
186
+ isFetching: boolean;
187
+ isInitialLoading: boolean;
188
+ isPaused: boolean;
189
+ isPlaceholderData: boolean;
190
+ isPreviousData: boolean;
191
+ isRefetching: boolean;
192
+ isStale: boolean;
193
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
194
+ remove: () => void;
195
+ fetchStatus: _tanstack_react_query.FetchStatus;
196
+ queryKey: [string, string, string, unknown, {
197
+ infinite: boolean;
198
+ optimisticUpdate: boolean;
199
+ }];
200
+ } | {
201
+ data: undefined;
202
+ error: null;
203
+ isError: false;
204
+ isLoading: true;
205
+ isLoadingError: false;
206
+ isRefetchError: false;
207
+ isSuccess: false;
208
+ status: "loading";
209
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
210
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
211
+ hasNextPage?: boolean;
212
+ hasPreviousPage?: boolean;
213
+ isFetchingNextPage: boolean;
214
+ isFetchingPreviousPage: boolean;
215
+ dataUpdatedAt: number;
216
+ errorUpdatedAt: number;
217
+ failureCount: number;
218
+ failureReason: TError | null;
219
+ errorUpdateCount: number;
220
+ isFetched: boolean;
221
+ isFetchedAfterMount: boolean;
222
+ isFetching: boolean;
223
+ isInitialLoading: boolean;
224
+ isPaused: boolean;
225
+ isPlaceholderData: boolean;
226
+ isPreviousData: boolean;
227
+ isRefetching: boolean;
228
+ isStale: boolean;
229
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
230
+ remove: () => void;
231
+ fetchStatus: _tanstack_react_query.FetchStatus;
232
+ queryKey: [string, string, string, unknown, {
233
+ infinite: boolean;
234
+ optimisticUpdate: boolean;
235
+ }];
236
+ } | {
237
+ data: _tanstack_react_query.InfiniteData<TData>;
238
+ error: TError;
239
+ isError: true;
240
+ isLoading: false;
241
+ isLoadingError: false;
242
+ isRefetchError: true;
243
+ isSuccess: false;
244
+ status: "error";
245
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
246
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
247
+ hasNextPage?: boolean;
248
+ hasPreviousPage?: boolean;
249
+ isFetchingNextPage: boolean;
250
+ isFetchingPreviousPage: boolean;
251
+ dataUpdatedAt: number;
252
+ errorUpdatedAt: number;
253
+ failureCount: number;
254
+ failureReason: TError | null;
255
+ errorUpdateCount: number;
256
+ isFetched: boolean;
257
+ isFetchedAfterMount: boolean;
258
+ isFetching: boolean;
259
+ isInitialLoading: boolean;
260
+ isPaused: boolean;
261
+ isPlaceholderData: boolean;
262
+ isPreviousData: boolean;
263
+ isRefetching: boolean;
264
+ isStale: boolean;
265
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
266
+ remove: () => void;
267
+ fetchStatus: _tanstack_react_query.FetchStatus;
268
+ queryKey: [string, string, string, unknown, {
269
+ infinite: boolean;
270
+ optimisticUpdate: boolean;
271
+ }];
272
+ } | {
273
+ data: _tanstack_react_query.InfiniteData<TData>;
274
+ error: null;
275
+ isError: false;
276
+ isLoading: false;
277
+ isLoadingError: false;
278
+ isRefetchError: false;
279
+ isSuccess: true;
280
+ status: "success";
281
+ fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
282
+ fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<TData, TError>>;
283
+ hasNextPage?: boolean;
284
+ hasPreviousPage?: boolean;
285
+ isFetchingNextPage: boolean;
286
+ isFetchingPreviousPage: boolean;
287
+ dataUpdatedAt: number;
288
+ errorUpdatedAt: number;
289
+ failureCount: number;
290
+ failureReason: TError | null;
291
+ errorUpdateCount: number;
292
+ isFetched: boolean;
293
+ isFetchedAfterMount: boolean;
294
+ isFetching: boolean;
295
+ isInitialLoading: boolean;
296
+ isPaused: boolean;
297
+ isPlaceholderData: boolean;
298
+ isPreviousData: boolean;
299
+ isRefetching: boolean;
300
+ isStale: boolean;
301
+ refetch: <TPageData>(options?: (_tanstack_react_query.RefetchOptions & _tanstack_react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<_tanstack_react_query.QueryObserverResult<_tanstack_react_query.InfiniteData<TData>, TError>>;
302
+ remove: () => void;
303
+ fetchStatus: _tanstack_react_query.FetchStatus;
304
+ queryKey: [string, string, string, unknown, {
305
+ infinite: boolean;
306
+ optimisticUpdate: boolean;
307
+ }];
308
+ };
45
309
  /**
46
310
  * Creates a mutation with react-query.
47
311
  *
package/runtime/react.js CHANGED
@@ -329,21 +329,27 @@ function getHooksContext() {
329
329
  }
330
330
  function useModelQuery(model, url, args, options, fetch2) {
331
331
  const reqUrl = makeUrl(url, args);
332
- return (0, import_react_query.useQuery)(__spreadValues({
333
- queryKey: getQueryKey(model, url, args, {
334
- infinite: false,
335
- optimisticUpdate: (options == null ? void 0 : options.optimisticUpdate) !== false
336
- }),
337
- queryFn: () => fetcher(reqUrl, void 0, fetch2, false)
338
- }, options));
332
+ const queryKey = getQueryKey(model, url, args, {
333
+ infinite: false,
334
+ optimisticUpdate: (options == null ? void 0 : options.optimisticUpdate) !== false
335
+ });
336
+ return __spreadValues({
337
+ queryKey
338
+ }, (0, import_react_query.useQuery)(__spreadValues({
339
+ queryKey,
340
+ queryFn: ({ signal }) => fetcher(reqUrl, { signal }, fetch2, false)
341
+ }, options)));
339
342
  }
340
343
  function useInfiniteModelQuery(model, url, args, options, fetch2) {
341
- return (0, import_react_query.useInfiniteQuery)(__spreadValues({
342
- queryKey: getQueryKey(model, url, args, { infinite: true, optimisticUpdate: false }),
343
- queryFn: ({ pageParam }) => {
344
- return fetcher(makeUrl(url, pageParam != null ? pageParam : args), void 0, fetch2, false);
344
+ const queryKey = getQueryKey(model, url, args, { infinite: true, optimisticUpdate: false });
345
+ return __spreadValues({
346
+ queryKey
347
+ }, (0, import_react_query.useInfiniteQuery)(__spreadValues({
348
+ queryKey,
349
+ queryFn: ({ pageParam, signal }) => {
350
+ return fetcher(makeUrl(url, pageParam != null ? pageParam : args), { signal }, fetch2, false);
345
351
  }
346
- }, options));
352
+ }, options)));
347
353
  }
348
354
  function useModelMutation(model, method, url, modelMeta, options, fetch2, checkReadBack) {
349
355
  const queryClient = (0, import_react_query.useQueryClient)();