Skip to content

Commit

Permalink
fix(graphql): don't close mutations after callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
micimize committed Jul 27, 2020
1 parent 76c8bf1 commit 2ba6c74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/graphql/lib/src/core/observable_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ class ObservableQuery {
lifecycle = QueryLifecycle.completed;
close();
}
// the mutation has been completed, but disposal has not been requested
if (lifecycle == QueryLifecycle.sideEffectsPending) {
lifecycle = QueryLifecycle.completed;
close();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/graphql_flutter/lib/src/widgets/mutation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ class MutationState extends State<Mutation> {
return (observableQuery
..variables = variables
..options.optimisticResult = optimisticResult
..onData(mutationCallbacks
.callbacks) // add callbacks to observable // interesting
..onData(mutationCallbacks.callbacks) // add callbacks to observable
)
.fetchResults();
}
Expand Down

0 comments on commit 2ba6c74

Please sign in to comment.