File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2
2
ApolloAction ,
3
3
isMutationInitAction ,
4
4
isMutationResultAction ,
5
+ isMutationErrorAction ,
5
6
isStoreResetAction ,
6
7
} from '../actions' ;
7
8
@@ -60,6 +61,13 @@ export function mutations(
60
61
} ) as MutationStoreValue ;
61
62
62
63
return newState ;
64
+ } else if ( isMutationErrorAction ( action ) ) {
65
+ const newState = assign ( { } , previousState ) as MutationStore ;
66
+
67
+ newState [ action . mutationId ] = assign ( { } , previousState [ action . mutationId ] , {
68
+ loading : false ,
69
+ error : action . error ,
70
+ } ) as MutationStoreValue ;
63
71
} else if ( isStoreResetAction ( action ) ) {
64
72
// if we are resetting the store, we no longer need information about the mutations
65
73
// that are currently in the store so we can just throw them all away.
You can’t perform that action at this time.
0 commit comments