File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 1
1
import type {
2
+ DefaultedInfiniteQueryObserverOptions ,
2
3
FetchNextPageOptions ,
3
4
FetchPreviousPageOptions ,
4
5
InfiniteData ,
@@ -84,7 +85,7 @@ export class InfiniteQueryObserver<
84
85
}
85
86
86
87
getOptimisticResult (
87
- options : InfiniteQueryObserverOptions <
88
+ options : DefaultedInfiniteQueryObserverOptions <
88
89
TQueryFnData ,
89
90
TError ,
90
91
TData ,
Original file line number Diff line number Diff line change 1
- import { RefetchPageFilters } from './types'
1
+ import { DefaultedQueryObserverOptions , RefetchPageFilters } from './types'
2
2
import {
3
3
isServer ,
4
4
isValidTimeout ,
@@ -205,21 +205,17 @@ export class QueryObserver<
205
205
}
206
206
207
207
getOptimisticResult (
208
- options : QueryObserverOptions <
208
+ options : DefaultedQueryObserverOptions <
209
209
TQueryFnData ,
210
210
TError ,
211
211
TData ,
212
212
TQueryData ,
213
213
TQueryKey
214
214
>
215
215
) : QueryObserverResult < TData , TError > {
216
- const defaultedOptions = this . client . defaultQueryOptions ( options )
217
-
218
- const query = this . client
219
- . getQueryCache ( )
220
- . build ( this . client , defaultedOptions )
216
+ const query = this . client . getQueryCache ( ) . build ( this . client , options )
221
217
222
- return this . createResult ( query , defaultedOptions )
218
+ return this . createResult ( query , options )
223
219
}
224
220
225
221
getCurrentResult ( ) : QueryObserverResult < TData , TError > {
Original file line number Diff line number Diff line change @@ -246,6 +246,23 @@ export interface InfiniteQueryObserverOptions<
246
246
TQueryKey
247
247
> { }
248
248
249
+ export type DefaultedInfiniteQueryObserverOptions <
250
+ TQueryFnData = unknown ,
251
+ TError = unknown ,
252
+ TData = TQueryFnData ,
253
+ TQueryData = TQueryFnData ,
254
+ TQueryKey extends QueryKey = QueryKey
255
+ > = WithRequired <
256
+ InfiniteQueryObserverOptions <
257
+ TQueryFnData ,
258
+ TError ,
259
+ TData ,
260
+ TQueryData ,
261
+ TQueryKey
262
+ > ,
263
+ 'useErrorBoundary' | 'refetchOnReconnect'
264
+ >
265
+
249
266
export interface FetchQueryOptions <
250
267
TQueryFnData = unknown ,
251
268
TError = unknown ,
You can’t perform that action at this time.
0 commit comments