diff --git a/packages/graphql/lib/src/cache/hive_store.dart b/packages/graphql/lib/src/cache/hive_store.dart index a10afa89d..a9efb53ed 100644 --- a/packages/graphql/lib/src/cache/hive_store.dart +++ b/packages/graphql/lib/src/cache/hive_store.dart @@ -25,8 +25,13 @@ class HiveStore extends Store { @protected final Box box; - /// Creates a HiveStore inititalized with [box], - HiveStore(this.box); + /// Creates a HiveStore inititalized with the given [box], defaulting to `Hive.box(defaultBoxName)` + /// + /// **N.B.**: [box] must already be [opened] with either [openBox], [open], or `initHiveForFlutter` from `graphql_flutter`. + /// This lets us decouple the async initialization logic, making store usage elsewhere much more straightforward. + /// + /// [opened]: https://docs.hivedb.dev/#/README?id=open-a-box + HiveStore([ Box box ]): this.box = box ?? Hive.box(defaultBoxName); @override Map get(String dataId) { diff --git a/packages/graphql/lib/src/core/query_options.dart b/packages/graphql/lib/src/core/query_options.dart index 488accb8e..7297ca9d8 100644 --- a/packages/graphql/lib/src/core/query_options.dart +++ b/packages/graphql/lib/src/core/query_options.dart @@ -142,10 +142,6 @@ class FetchMoreOptions { this.variables = const {}, @required this.updateQuery, }) : assert(updateQuery != null), - assert( - (document ?? documentNode) != null, - 'document must not be null', - ), this.document = document ?? documentNode; DocumentNode document; diff --git a/packages/graphql_flutter/pubspec.yaml b/packages/graphql_flutter/pubspec.yaml index 1a6288349..626480225 100644 --- a/packages/graphql_flutter/pubspec.yaml +++ b/packages/graphql_flutter/pubspec.yaml @@ -6,10 +6,7 @@ version: 4.0.0-alpha.1 homepage: https://github.com/zino-app/graphql-flutter/tree/master/packages/graphql_flutter dependencies: graphql: - git: - url: https://github.com/brewhackers-technologies/graphql-flutter.git - ref: modularization - path: packages/graphql + path: ../graphql gql_exec: ^0.2.2 flutter: sdk: flutter @@ -29,7 +26,6 @@ dev_dependencies: environment: sdk: ">=2.6.0 <3.0.0" - # dependency_overrides: # graphql: # path: ../graphql