Skip to content

Commit

Permalink
feat(graphql): HiveStore api improvements, fetchmore fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
micimize committed Jul 23, 2020
1 parent 22db4f7 commit 2d1a7f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
9 changes: 7 additions & 2 deletions packages/graphql/lib/src/cache/hive_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, dynamic> get(String dataId) {
Expand Down
4 changes: 0 additions & 4 deletions packages/graphql/lib/src/core/query_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions packages/graphql_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,7 +26,6 @@ dev_dependencies:

environment:
sdk: ">=2.6.0 <3.0.0"

# dependency_overrides:
# graphql:
# path: ../graphql

0 comments on commit 2d1a7f2

Please sign in to comment.