diff --git a/Makefile b/Makefile index 72a8eba83..ca11c4a4d 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CC_CHANGELOG=dart pub global run changelog_cmd default: analyze check dep: - dart pub global activate melos; + dart pub global activate melos 2.9.0; # dart pub global activate changelog_cmd; $(CC) bootstrap diff --git a/packages/graphql/lib/src/core/query_options.dart b/packages/graphql/lib/src/core/query_options.dart index 74a8837d6..529b06219 100644 --- a/packages/graphql/lib/src/core/query_options.dart +++ b/packages/graphql/lib/src/core/query_options.dart @@ -9,7 +9,7 @@ import 'package:gql/ast.dart'; import 'package:graphql/client.dart'; import 'package:meta/meta.dart'; -typedef OnQueryComplete = FutureOr Function(Map data); +typedef OnQueryComplete = FutureOr Function(Map? data); typedef OnQueryError = FutureOr Function(OperationException? error); @@ -366,7 +366,7 @@ class QueryCallbackHandler { if (options.onComplete != null) { return (QueryResult? result) { if (!result!.isLoading && !result.isOptimistic) { - return options.onComplete!(result.data ?? {}); + return options.onComplete!(result.data); } }; }