@tanstack/query-core 4.10.3 → 4.13.0
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 +1 -1
- package/build/lib/mutation.d.ts +5 -2
- package/build/lib/mutation.esm.js +15 -6
- package/build/lib/mutation.esm.js.map +1 -1
- package/build/lib/mutation.js +15 -6
- package/build/lib/mutation.js.map +1 -1
- package/build/lib/mutation.mjs +15 -6
- package/build/lib/mutation.mjs.map +1 -1
- package/build/lib/mutationCache.d.ts +3 -3
- package/build/lib/mutationCache.esm.js.map +1 -1
- package/build/lib/mutationCache.js.map +1 -1
- package/build/lib/mutationCache.mjs.map +1 -1
- package/build/lib/query.d.ts +5 -2
- package/build/lib/query.esm.js +11 -4
- package/build/lib/query.esm.js.map +1 -1
- package/build/lib/query.js +11 -4
- package/build/lib/query.js.map +1 -1
- package/build/lib/query.mjs +11 -4
- package/build/lib/query.mjs.map +1 -1
- package/build/lib/queryObserver.esm.js +1 -0
- package/build/lib/queryObserver.esm.js.map +1 -1
- package/build/lib/queryObserver.js +1 -0
- package/build/lib/queryObserver.js.map +1 -1
- package/build/lib/queryObserver.mjs +1 -0
- package/build/lib/queryObserver.mjs.map +1 -1
- package/build/lib/types.d.ts +1 -0
- package/build/umd/index.development.js +27 -10
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +5 -3
- package/src/mutation.ts +18 -8
- package/src/mutationCache.ts +3 -3
- package/src/query.ts +13 -5
- package/src/queryObserver.ts +1 -0
- package/src/tests/mutationCache.test.tsx +76 -0
- package/src/tests/mutations.test.tsx +13 -1
- package/src/tests/utils.ts +6 -4
- package/src/types.ts +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/query-core",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "4.13.0",
|
|
4
|
+
"description": "The framework agnostic core that powers TanStack Query",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "tanstack/query",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "rm -rf ./build",
|
|
32
|
-
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src"
|
|
32
|
+
"test:eslint": "../../node_modules/.bin/eslint --ext .ts,.tsx ./src",
|
|
33
|
+
"test:jest": "../../node_modules/.bin/jest --config ./jest.config.ts",
|
|
34
|
+
"test:dev": "pnpm run test:jest --watch"
|
|
33
35
|
}
|
|
34
36
|
}
|
package/src/mutation.ts
CHANGED
|
@@ -30,13 +30,16 @@ export interface MutationState<
|
|
|
30
30
|
data: TData | undefined
|
|
31
31
|
error: TError | null
|
|
32
32
|
failureCount: number
|
|
33
|
+
failureReason: TError | null
|
|
33
34
|
isPaused: boolean
|
|
34
35
|
status: MutationStatus
|
|
35
36
|
variables: TVariables | undefined
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
interface FailedAction {
|
|
39
|
+
interface FailedAction<TError> {
|
|
39
40
|
type: 'failed'
|
|
41
|
+
failureCount: number
|
|
42
|
+
error: TError | null
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
interface LoadingAction<TVariables, TContext> {
|
|
@@ -71,7 +74,7 @@ interface SetStateAction<TData, TError, TVariables, TContext> {
|
|
|
71
74
|
export type Action<TData, TError, TVariables, TContext> =
|
|
72
75
|
| ContinueAction
|
|
73
76
|
| ErrorAction<TError>
|
|
74
|
-
| FailedAction
|
|
77
|
+
| FailedAction<TError>
|
|
75
78
|
| LoadingAction<TVariables, TContext>
|
|
76
79
|
| PauseAction
|
|
77
80
|
| SetStateAction<TData, TError, TVariables, TContext>
|
|
@@ -171,8 +174,8 @@ export class Mutation<
|
|
|
171
174
|
}
|
|
172
175
|
return this.options.mutationFn(this.state.variables!)
|
|
173
176
|
},
|
|
174
|
-
onFail: () => {
|
|
175
|
-
this.dispatch({ type: 'failed' })
|
|
177
|
+
onFail: (failureCount, error) => {
|
|
178
|
+
this.dispatch({ type: 'failed', failureCount, error })
|
|
176
179
|
},
|
|
177
180
|
onPause: () => {
|
|
178
181
|
this.dispatch({ type: 'pause' })
|
|
@@ -193,7 +196,7 @@ export class Mutation<
|
|
|
193
196
|
if (!restored) {
|
|
194
197
|
this.dispatch({ type: 'loading', variables: this.options.variables! })
|
|
195
198
|
// Notify cache callback
|
|
196
|
-
this.mutationCache.config.onMutate?.(
|
|
199
|
+
await this.mutationCache.config.onMutate?.(
|
|
197
200
|
this.state.variables,
|
|
198
201
|
this as Mutation<unknown, unknown, unknown, unknown>,
|
|
199
202
|
)
|
|
@@ -209,7 +212,7 @@ export class Mutation<
|
|
|
209
212
|
const data = await executeMutation()
|
|
210
213
|
|
|
211
214
|
// Notify cache callback
|
|
212
|
-
this.mutationCache.config.onSuccess?.(
|
|
215
|
+
await this.mutationCache.config.onSuccess?.(
|
|
213
216
|
data,
|
|
214
217
|
this.state.variables,
|
|
215
218
|
this.state.context,
|
|
@@ -234,7 +237,7 @@ export class Mutation<
|
|
|
234
237
|
} catch (error) {
|
|
235
238
|
try {
|
|
236
239
|
// Notify cache callback
|
|
237
|
-
this.mutationCache.config.onError?.(
|
|
240
|
+
await this.mutationCache.config.onError?.(
|
|
238
241
|
error,
|
|
239
242
|
this.state.variables,
|
|
240
243
|
this.state.context,
|
|
@@ -272,7 +275,8 @@ export class Mutation<
|
|
|
272
275
|
case 'failed':
|
|
273
276
|
return {
|
|
274
277
|
...state,
|
|
275
|
-
failureCount:
|
|
278
|
+
failureCount: action.failureCount,
|
|
279
|
+
failureReason: action.error,
|
|
276
280
|
}
|
|
277
281
|
case 'pause':
|
|
278
282
|
return {
|
|
@@ -289,6 +293,8 @@ export class Mutation<
|
|
|
289
293
|
...state,
|
|
290
294
|
context: action.context,
|
|
291
295
|
data: undefined,
|
|
296
|
+
failureCount: 0,
|
|
297
|
+
failureReason: null,
|
|
292
298
|
error: null,
|
|
293
299
|
isPaused: !canFetch(this.options.networkMode),
|
|
294
300
|
status: 'loading',
|
|
@@ -298,6 +304,8 @@ export class Mutation<
|
|
|
298
304
|
return {
|
|
299
305
|
...state,
|
|
300
306
|
data: action.data,
|
|
307
|
+
failureCount: 0,
|
|
308
|
+
failureReason: null,
|
|
301
309
|
error: null,
|
|
302
310
|
status: 'success',
|
|
303
311
|
isPaused: false,
|
|
@@ -308,6 +316,7 @@ export class Mutation<
|
|
|
308
316
|
data: undefined,
|
|
309
317
|
error: action.error,
|
|
310
318
|
failureCount: state.failureCount + 1,
|
|
319
|
+
failureReason: action.error,
|
|
311
320
|
isPaused: false,
|
|
312
321
|
status: 'error',
|
|
313
322
|
}
|
|
@@ -344,6 +353,7 @@ export function getDefaultState<
|
|
|
344
353
|
data: undefined,
|
|
345
354
|
error: null,
|
|
346
355
|
failureCount: 0,
|
|
356
|
+
failureReason: null,
|
|
347
357
|
isPaused: false,
|
|
348
358
|
status: 'idle',
|
|
349
359
|
variables: undefined,
|
package/src/mutationCache.ts
CHANGED
|
@@ -16,17 +16,17 @@ interface MutationCacheConfig {
|
|
|
16
16
|
variables: unknown,
|
|
17
17
|
context: unknown,
|
|
18
18
|
mutation: Mutation<unknown, unknown, unknown>,
|
|
19
|
-
) =>
|
|
19
|
+
) => Promise<unknown> | unknown
|
|
20
20
|
onSuccess?: (
|
|
21
21
|
data: unknown,
|
|
22
22
|
variables: unknown,
|
|
23
23
|
context: unknown,
|
|
24
24
|
mutation: Mutation<unknown, unknown, unknown>,
|
|
25
|
-
) =>
|
|
25
|
+
) => Promise<unknown> | unknown
|
|
26
26
|
onMutate?: (
|
|
27
27
|
variables: unknown,
|
|
28
28
|
mutation: Mutation<unknown, unknown, unknown, unknown>,
|
|
29
|
-
) =>
|
|
29
|
+
) => Promise<unknown> | unknown
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
interface NotifyEventMutationAdded {
|
package/src/query.ts
CHANGED
|
@@ -45,6 +45,7 @@ export interface QueryState<TData = unknown, TError = unknown> {
|
|
|
45
45
|
errorUpdateCount: number
|
|
46
46
|
errorUpdatedAt: number
|
|
47
47
|
fetchFailureCount: number
|
|
48
|
+
fetchFailureReason: TError | null
|
|
48
49
|
fetchMeta: any
|
|
49
50
|
isInvalidated: boolean
|
|
50
51
|
status: QueryStatus
|
|
@@ -82,8 +83,10 @@ export interface FetchOptions {
|
|
|
82
83
|
meta?: any
|
|
83
84
|
}
|
|
84
85
|
|
|
85
|
-
interface FailedAction {
|
|
86
|
+
interface FailedAction<TError> {
|
|
86
87
|
type: 'failed'
|
|
88
|
+
failureCount: number
|
|
89
|
+
error: TError
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
interface FetchAction {
|
|
@@ -124,7 +127,7 @@ interface SetStateAction<TData, TError> {
|
|
|
124
127
|
export type Action<TData, TError> =
|
|
125
128
|
| ContinueAction
|
|
126
129
|
| ErrorAction<TError>
|
|
127
|
-
| FailedAction
|
|
130
|
+
| FailedAction<TError>
|
|
128
131
|
| FetchAction
|
|
129
132
|
| InvalidateAction
|
|
130
133
|
| PauseAction
|
|
@@ -473,8 +476,8 @@ export class Query<
|
|
|
473
476
|
this.isFetchingOptimistic = false
|
|
474
477
|
},
|
|
475
478
|
onError,
|
|
476
|
-
onFail: () => {
|
|
477
|
-
this.dispatch({ type: 'failed' })
|
|
479
|
+
onFail: (failureCount, error) => {
|
|
480
|
+
this.dispatch({ type: 'failed', failureCount, error })
|
|
478
481
|
},
|
|
479
482
|
onPause: () => {
|
|
480
483
|
this.dispatch({ type: 'pause' })
|
|
@@ -500,7 +503,8 @@ export class Query<
|
|
|
500
503
|
case 'failed':
|
|
501
504
|
return {
|
|
502
505
|
...state,
|
|
503
|
-
fetchFailureCount:
|
|
506
|
+
fetchFailureCount: action.failureCount,
|
|
507
|
+
fetchFailureReason: action.error,
|
|
504
508
|
}
|
|
505
509
|
case 'pause':
|
|
506
510
|
return {
|
|
@@ -516,6 +520,7 @@ export class Query<
|
|
|
516
520
|
return {
|
|
517
521
|
...state,
|
|
518
522
|
fetchFailureCount: 0,
|
|
523
|
+
fetchFailureReason: null,
|
|
519
524
|
fetchMeta: action.meta ?? null,
|
|
520
525
|
fetchStatus: canFetch(this.options.networkMode)
|
|
521
526
|
? 'fetching'
|
|
@@ -537,6 +542,7 @@ export class Query<
|
|
|
537
542
|
...(!action.manual && {
|
|
538
543
|
fetchStatus: 'idle',
|
|
539
544
|
fetchFailureCount: 0,
|
|
545
|
+
fetchFailureReason: null,
|
|
540
546
|
}),
|
|
541
547
|
}
|
|
542
548
|
case 'error':
|
|
@@ -552,6 +558,7 @@ export class Query<
|
|
|
552
558
|
errorUpdateCount: state.errorUpdateCount + 1,
|
|
553
559
|
errorUpdatedAt: Date.now(),
|
|
554
560
|
fetchFailureCount: state.fetchFailureCount + 1,
|
|
561
|
+
fetchFailureReason: error as TError,
|
|
555
562
|
fetchStatus: 'idle',
|
|
556
563
|
status: 'error',
|
|
557
564
|
}
|
|
@@ -611,6 +618,7 @@ function getDefaultState<
|
|
|
611
618
|
errorUpdateCount: 0,
|
|
612
619
|
errorUpdatedAt: 0,
|
|
613
620
|
fetchFailureCount: 0,
|
|
621
|
+
fetchFailureReason: null,
|
|
614
622
|
fetchMeta: null,
|
|
615
623
|
isInvalidated: false,
|
|
616
624
|
status: hasData ? 'success' : 'loading',
|
package/src/queryObserver.ts
CHANGED
|
@@ -562,6 +562,7 @@ export class QueryObserver<
|
|
|
562
562
|
error,
|
|
563
563
|
errorUpdatedAt,
|
|
564
564
|
failureCount: state.fetchFailureCount,
|
|
565
|
+
failureReason: state.fetchFailureReason,
|
|
565
566
|
errorUpdateCount: state.errorUpdateCount,
|
|
566
567
|
isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,
|
|
567
568
|
isFetchedAfterMount:
|
|
@@ -22,6 +22,33 @@ describe('mutationCache', () => {
|
|
|
22
22
|
const mutation = testCache.getAll()[0]
|
|
23
23
|
expect(onError).toHaveBeenCalledWith('error', 'vars', 'context', mutation)
|
|
24
24
|
})
|
|
25
|
+
|
|
26
|
+
test('should be awaited', async () => {
|
|
27
|
+
const key = queryKey()
|
|
28
|
+
const states: Array<number> = []
|
|
29
|
+
const onError = async () => {
|
|
30
|
+
states.push(1)
|
|
31
|
+
await sleep(1)
|
|
32
|
+
states.push(2)
|
|
33
|
+
}
|
|
34
|
+
const testCache = new MutationCache({ onError })
|
|
35
|
+
const testClient = createQueryClient({ mutationCache: testCache })
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
await executeMutation(testClient, {
|
|
39
|
+
mutationKey: key,
|
|
40
|
+
variables: 'vars',
|
|
41
|
+
mutationFn: () => Promise.reject('error'),
|
|
42
|
+
onError: async () => {
|
|
43
|
+
states.push(3)
|
|
44
|
+
await sleep(1)
|
|
45
|
+
states.push(4)
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
} catch {}
|
|
49
|
+
|
|
50
|
+
expect(states).toEqual([1, 2, 3, 4])
|
|
51
|
+
})
|
|
25
52
|
})
|
|
26
53
|
describe('MutationCacheConfig.onSuccess', () => {
|
|
27
54
|
test('should be called when a mutation is successful', async () => {
|
|
@@ -47,6 +74,30 @@ describe('mutationCache', () => {
|
|
|
47
74
|
mutation,
|
|
48
75
|
)
|
|
49
76
|
})
|
|
77
|
+
test('should be awaited', async () => {
|
|
78
|
+
const key = queryKey()
|
|
79
|
+
const states: Array<number> = []
|
|
80
|
+
const onSuccess = async () => {
|
|
81
|
+
states.push(1)
|
|
82
|
+
await sleep(1)
|
|
83
|
+
states.push(2)
|
|
84
|
+
}
|
|
85
|
+
const testCache = new MutationCache({ onSuccess })
|
|
86
|
+
const testClient = createQueryClient({ mutationCache: testCache })
|
|
87
|
+
|
|
88
|
+
await executeMutation(testClient, {
|
|
89
|
+
mutationKey: key,
|
|
90
|
+
variables: 'vars',
|
|
91
|
+
mutationFn: () => Promise.resolve({ data: 5 }),
|
|
92
|
+
onSuccess: async () => {
|
|
93
|
+
states.push(3)
|
|
94
|
+
await sleep(1)
|
|
95
|
+
states.push(4)
|
|
96
|
+
},
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
expect(states).toEqual([1, 2, 3, 4])
|
|
100
|
+
})
|
|
50
101
|
})
|
|
51
102
|
describe('MutationCacheConfig.onMutate', () => {
|
|
52
103
|
test('should be called before a mutation executes', async () => {
|
|
@@ -67,6 +118,31 @@ describe('mutationCache', () => {
|
|
|
67
118
|
const mutation = testCache.getAll()[0]
|
|
68
119
|
expect(onMutate).toHaveBeenCalledWith('vars', mutation)
|
|
69
120
|
})
|
|
121
|
+
|
|
122
|
+
test('should be awaited', async () => {
|
|
123
|
+
const key = queryKey()
|
|
124
|
+
const states: Array<number> = []
|
|
125
|
+
const onMutate = async () => {
|
|
126
|
+
states.push(1)
|
|
127
|
+
await sleep(1)
|
|
128
|
+
states.push(2)
|
|
129
|
+
}
|
|
130
|
+
const testCache = new MutationCache({ onMutate })
|
|
131
|
+
const testClient = createQueryClient({ mutationCache: testCache })
|
|
132
|
+
|
|
133
|
+
await executeMutation(testClient, {
|
|
134
|
+
mutationKey: key,
|
|
135
|
+
variables: 'vars',
|
|
136
|
+
mutationFn: () => Promise.resolve({ data: 5 }),
|
|
137
|
+
onMutate: async () => {
|
|
138
|
+
states.push(3)
|
|
139
|
+
await sleep(1)
|
|
140
|
+
states.push(4)
|
|
141
|
+
},
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
expect(states).toEqual([1, 2, 3, 4])
|
|
145
|
+
})
|
|
70
146
|
})
|
|
71
147
|
|
|
72
148
|
describe('find', () => {
|
|
@@ -71,6 +71,7 @@ describe('mutations', () => {
|
|
|
71
71
|
data: undefined,
|
|
72
72
|
error: null,
|
|
73
73
|
failureCount: 0,
|
|
74
|
+
failureReason: null,
|
|
74
75
|
isError: false,
|
|
75
76
|
isIdle: true,
|
|
76
77
|
isLoading: false,
|
|
@@ -97,6 +98,7 @@ describe('mutations', () => {
|
|
|
97
98
|
data: undefined,
|
|
98
99
|
error: null,
|
|
99
100
|
failureCount: 0,
|
|
101
|
+
failureReason: null,
|
|
100
102
|
isError: false,
|
|
101
103
|
isIdle: false,
|
|
102
104
|
isLoading: true,
|
|
@@ -115,6 +117,7 @@ describe('mutations', () => {
|
|
|
115
117
|
data: undefined,
|
|
116
118
|
error: null,
|
|
117
119
|
failureCount: 0,
|
|
120
|
+
failureReason: null,
|
|
118
121
|
isError: false,
|
|
119
122
|
isIdle: false,
|
|
120
123
|
isLoading: true,
|
|
@@ -133,6 +136,7 @@ describe('mutations', () => {
|
|
|
133
136
|
data: 'todo',
|
|
134
137
|
error: null,
|
|
135
138
|
failureCount: 0,
|
|
139
|
+
failureReason: null,
|
|
136
140
|
isError: false,
|
|
137
141
|
isIdle: false,
|
|
138
142
|
isLoading: false,
|
|
@@ -172,6 +176,7 @@ describe('mutations', () => {
|
|
|
172
176
|
data: undefined,
|
|
173
177
|
error: null,
|
|
174
178
|
failureCount: 0,
|
|
179
|
+
failureReason: null,
|
|
175
180
|
isError: false,
|
|
176
181
|
isIdle: false,
|
|
177
182
|
isLoading: true,
|
|
@@ -190,6 +195,7 @@ describe('mutations', () => {
|
|
|
190
195
|
data: undefined,
|
|
191
196
|
error: null,
|
|
192
197
|
failureCount: 0,
|
|
198
|
+
failureReason: null,
|
|
193
199
|
isError: false,
|
|
194
200
|
isIdle: false,
|
|
195
201
|
isLoading: true,
|
|
@@ -208,6 +214,7 @@ describe('mutations', () => {
|
|
|
208
214
|
data: undefined,
|
|
209
215
|
error: null,
|
|
210
216
|
failureCount: 1,
|
|
217
|
+
failureReason: 'err',
|
|
211
218
|
isError: false,
|
|
212
219
|
isIdle: false,
|
|
213
220
|
isLoading: true,
|
|
@@ -226,6 +233,7 @@ describe('mutations', () => {
|
|
|
226
233
|
data: undefined,
|
|
227
234
|
error: 'err',
|
|
228
235
|
failureCount: 2,
|
|
236
|
+
failureReason: 'err',
|
|
229
237
|
isError: true,
|
|
230
238
|
isIdle: false,
|
|
231
239
|
isLoading: false,
|
|
@@ -264,6 +272,7 @@ describe('mutations', () => {
|
|
|
264
272
|
data: undefined,
|
|
265
273
|
error: null,
|
|
266
274
|
failureCount: 1,
|
|
275
|
+
failureReason: 'err',
|
|
267
276
|
isPaused: true,
|
|
268
277
|
status: 'loading',
|
|
269
278
|
variables: 'todo',
|
|
@@ -275,6 +284,7 @@ describe('mutations', () => {
|
|
|
275
284
|
data: undefined,
|
|
276
285
|
error: null,
|
|
277
286
|
failureCount: 1,
|
|
287
|
+
failureReason: 'err',
|
|
278
288
|
isPaused: true,
|
|
279
289
|
status: 'loading',
|
|
280
290
|
variables: 'todo',
|
|
@@ -286,7 +296,8 @@ describe('mutations', () => {
|
|
|
286
296
|
context: 'todo',
|
|
287
297
|
data: 'todo',
|
|
288
298
|
error: null,
|
|
289
|
-
failureCount:
|
|
299
|
+
failureCount: 0,
|
|
300
|
+
failureReason: null,
|
|
290
301
|
isPaused: false,
|
|
291
302
|
status: 'success',
|
|
292
303
|
variables: 'todo',
|
|
@@ -316,6 +327,7 @@ describe('mutations', () => {
|
|
|
316
327
|
data: 'new',
|
|
317
328
|
error: undefined,
|
|
318
329
|
failureCount: 0,
|
|
330
|
+
failureReason: null,
|
|
319
331
|
isPaused: false,
|
|
320
332
|
status: 'success',
|
|
321
333
|
})
|
package/src/tests/utils.ts
CHANGED
|
@@ -65,11 +65,13 @@ export const executeMutation = (
|
|
|
65
65
|
// so that we can pretend to be in a server environment
|
|
66
66
|
export function setIsServer(isServer: boolean) {
|
|
67
67
|
const original = utils.isServer
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
Object.defineProperty(utils, 'isServer', {
|
|
69
|
+
get: () => isServer,
|
|
70
|
+
})
|
|
70
71
|
|
|
71
72
|
return () => {
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
Object.defineProperty(utils, 'isServer', {
|
|
74
|
+
get: () => original,
|
|
75
|
+
})
|
|
74
76
|
}
|
|
75
77
|
}
|
package/src/types.ts
CHANGED
|
@@ -370,6 +370,7 @@ export interface QueryObserverBaseResult<TData = unknown, TError = unknown> {
|
|
|
370
370
|
error: TError | null
|
|
371
371
|
errorUpdatedAt: number
|
|
372
372
|
failureCount: number
|
|
373
|
+
failureReason: TError | null
|
|
373
374
|
errorUpdateCount: number
|
|
374
375
|
isError: boolean
|
|
375
376
|
isFetched: boolean
|