Skip to content

Commit

Permalink
feat(client): QueryResult.unexecuted
Browse files Browse the repository at this point in the history
  • Loading branch information
micimize committed Jan 24, 2021
1 parent 53832be commit 13e3257
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/graphql/lib/src/core/query_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@ class QueryResult {
@required this.source,
}) : timestamp = DateTime.now();

/// An empty result. Can be used as a placeholder when an operation
/// has not been executed yet.
factory QueryResult.empty() => QueryResult(source: null);
/// Unexecuted singleton, used as a placeholder for mutations,
/// etc.
static final unexecuted = QueryResult(source: null)
..timestamp = DateTime.fromMillisecondsSinceEpoch(0);

factory QueryResult.loading({
Map<String, dynamic> data,
Expand Down
1 change: 0 additions & 1 deletion packages/graphql/lib/src/graphql_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class GraphQLClient implements GraphQLDataProxy {
/// 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
@experimental
ObservableQuery watchMutation(WatchQueryOptions options) {
options.policies =
defaultPolicies.watchMutation.withOverrides(options.policies);
Expand Down

0 comments on commit 13e3257

Please sign in to comment.