Skip to content

Commit 6aea6c8

Browse files
committed
Add undefined error and data properties to the descriminated union to improve usability
1 parent c189792 commit 6aea6c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/toolkit/src/query/core/buildInitiate.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,12 @@ type StartMutationActionCreator<
9393
export type MutationActionCreatorResult<
9494
D extends MutationDefinition<any, any, any, any>,
9595
> = SafePromise<
96-
| { data: ResultTypeFrom<D> }
9796
| {
97+
data: ResultTypeFrom<D>
98+
error?: undefined
99+
}
100+
| {
101+
data?: undefined
98102
error:
99103
| Exclude<
100104
BaseQueryError<

0 commit comments

Comments
 (0)