diff --git a/packages/graphql/lib/src/core/query_manager.dart b/packages/graphql/lib/src/core/query_manager.dart index c76c22938..0cee710fd 100644 --- a/packages/graphql/lib/src/core/query_manager.dart +++ b/packages/graphql/lib/src/core/query_manager.dart @@ -51,7 +51,24 @@ class QueryManager { } Future mutate(MutationOptions options) { - return fetchQuery('0', options); + return fetchQuery('0', options).then((result) async { + // not sure why query id is '0', may be needs improvements + // once the mutation has been process successfully, execute callbacks + // before returning the results + final mutationCallbacks = MutationCallbacks( + cache: cache, + options: options, + queryId: '0', + ); + + final callbacks = mutationCallbacks.callbacks; + + for (final callback in callbacks) { + await callback(result); + } + + return result; + }); } Future fetchQuery(