watchMutation<TParsed> method

ObservableQuery<TParsed> watchMutation<TParsed>(
  1. WatchQueryOptions<TParsed> options
)

watchMutation is the same as watchQuery, but with a different defaultPolicies that are more appropriate for mutations.

This is a stop-gap solution to the problems created by the reliance of graphql_flutter on ObservableQuery for mutations.

For more details, see https://github.com/zino-app/graphql-flutter/issues/774

Implementation

ObservableQuery<TParsed> watchMutation<TParsed>(
    WatchQueryOptions<TParsed> options) {
  final policies =
      defaultPolicies.watchMutation.withOverrides(options.policies);
  return queryManager.watchQuery(options.copyWithPolicies(policies));
}