From ee7d10d2963dd94eccd3cd702a39961da0087ed1 Mon Sep 17 00:00:00 2001 From: Martin Kamleithner Date: Sun, 22 Sep 2024 11:06:57 +0100 Subject: [PATCH] chore(deps)!: upgrade rxdart to v0.28.0 --- .../lib/src/request_controller_typed_link.dart | 2 +- packages/ferry/pubspec.yaml | 2 +- .../ferry/test/client/json_operation_test.dart | 17 ++++++++++------- .../lib/src/utils/operation_root_data.dart | 4 ++-- packages/ferry_cache/pubspec.yaml | 2 +- packages/ferry_hive_store/pubspec.yaml | 2 +- packages/ferry_store/pubspec.yaml | 2 +- .../lib/queries/books.graphql | 14 ++++++++++++++ packages/ferry_test_graphql2/pubspec.yaml | 2 +- .../lib/src/utils/operation_field_names.dart | 2 +- 10 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 packages/ferry_test_graphql2/lib/queries/books.graphql diff --git a/packages/ferry/lib/src/request_controller_typed_link.dart b/packages/ferry/lib/src/request_controller_typed_link.dart index a989a1f1..83457ad9 100644 --- a/packages/ferry/lib/src/request_controller_typed_link.dart +++ b/packages/ferry/lib/src/request_controller_typed_link.dart @@ -69,7 +69,7 @@ class RequestControllerTypedLink extends TypedLink { /// Temporarily add a listener so that [prev] doesn't shut down when /// switchMap is updating the stream. final sub = prev?.listen(null); - scheduleMicrotask(() => sub?.cancel()); + Future.delayed(Duration.zero, () => sub?.cancel()); }, ).switchMap( (req) { diff --git a/packages/ferry/pubspec.yaml b/packages/ferry/pubspec.yaml index e41b7871..7bbf8e42 100644 --- a/packages/ferry/pubspec.yaml +++ b/packages/ferry/pubspec.yaml @@ -12,7 +12,7 @@ topics: - ferry dependencies: gql: '>=0.14.0 <2.0.0' - rxdart: ^0.27.1 + rxdart: ^0.28.0 gql_link: '>=0.5.0 <2.0.0' gql_exec: '>=0.4.0 <2.0.0' meta: ^1.3.0 diff --git a/packages/ferry/test/client/json_operation_test.dart b/packages/ferry/test/client/json_operation_test.dart index 0e73a580..90017808 100644 --- a/packages/ferry/test/client/json_operation_test.dart +++ b/packages/ferry/test/client/json_operation_test.dart @@ -15,18 +15,21 @@ void main() { addTearDown(client.dispose); - final req = - JsonOperationRequest(operation: Operation(document: gql.parseString(r''' + final req = JsonOperationRequest( + operation: Operation(document: gql.parseString(r''' query Reviews { reviews(episode: $episode, first: $first, offset: $offset) { id stars } - }''')), fetchPolicy: FetchPolicy.CacheFirst, vars: { - 'episode': 'NEWHOPE', - 'first': 3, - 'offset': 0, - }); + }''')), + fetchPolicy: FetchPolicy.CacheFirst, + vars: { + 'episode': 'NEWHOPE', + 'first': 3, + 'offset': 0, + }, + ); final result = await client.request(req).first; diff --git a/packages/ferry_cache/lib/src/utils/operation_root_data.dart b/packages/ferry_cache/lib/src/utils/operation_root_data.dart index 561f67eb..33ecdd90 100644 --- a/packages/ferry_cache/lib/src/utils/operation_root_data.dart +++ b/packages/ferry_cache/lib/src/utils/operation_root_data.dart @@ -13,8 +13,8 @@ Map operationRootData( ) { final fieldNames = operationFieldNames( request.operation.document, - request.operation.operationName!, - (request.vars as dynamic).toJson(), + request.operation.operationName, + request.varsToJson(), typePolicies, possibleTypes, ); diff --git a/packages/ferry_cache/pubspec.yaml b/packages/ferry_cache/pubspec.yaml index 985a62c2..42b64535 100644 --- a/packages/ferry_cache/pubspec.yaml +++ b/packages/ferry_cache/pubspec.yaml @@ -12,7 +12,7 @@ topics: dependencies: ferry_exec: ^0.6.1-dev.1 meta: ^1.3.0 - rxdart: ^0.27.1 + rxdart: ^0.28.0 normalize: ^0.9.1 ferry_store: ^0.6.0-dev.0 collection: ^1.15.0 diff --git a/packages/ferry_hive_store/pubspec.yaml b/packages/ferry_hive_store/pubspec.yaml index e8eeee7e..83960b4e 100644 --- a/packages/ferry_hive_store/pubspec.yaml +++ b/packages/ferry_hive_store/pubspec.yaml @@ -13,7 +13,7 @@ topics: dependencies: hive: ^2.0.0 ferry_store: ^0.6.0-dev.0 - rxdart: ^0.27.1 + rxdart: ^0.28.0 collection: ^1.15.0 dev_dependencies: test: ^1.16.8 diff --git a/packages/ferry_store/pubspec.yaml b/packages/ferry_store/pubspec.yaml index 55cf3320..0ab09de2 100644 --- a/packages/ferry_store/pubspec.yaml +++ b/packages/ferry_store/pubspec.yaml @@ -10,7 +10,7 @@ topics: - gql - ferry dependencies: - rxdart: ^0.27.1 + rxdart: ^0.28.0 collection: ^1.15.0 dev_dependencies: test: ^1.16.8 diff --git a/packages/ferry_test_graphql2/lib/queries/books.graphql b/packages/ferry_test_graphql2/lib/queries/books.graphql new file mode 100644 index 00000000..bec02696 --- /dev/null +++ b/packages/ferry_test_graphql2/lib/queries/books.graphql @@ -0,0 +1,14 @@ + + + +query GetBooks { + books { + title + ... on Textbook { + courses + } + ... on ColoringBook { + colors + } + } +} \ No newline at end of file diff --git a/packages/ferry_test_graphql2/pubspec.yaml b/packages/ferry_test_graphql2/pubspec.yaml index 2afb83bd..8df21b30 100644 --- a/packages/ferry_test_graphql2/pubspec.yaml +++ b/packages/ferry_test_graphql2/pubspec.yaml @@ -19,6 +19,6 @@ dev_dependencies: pedantic: ^1.11.0 built_value_generator: ^8.1.1 dart_style: ^2.3.2 - ferry_generator: + ferry_generator: ^0.12.0 diff --git a/packages/normalize/lib/src/utils/operation_field_names.dart b/packages/normalize/lib/src/utils/operation_field_names.dart index 5a22fe9c..eb426fff 100644 --- a/packages/normalize/lib/src/utils/operation_field_names.dart +++ b/packages/normalize/lib/src/utils/operation_field_names.dart @@ -10,7 +10,7 @@ import 'package:normalize/src/policies/type_policy.dart'; /// Returns the root field names for a given operation. List operationFieldNames( DocumentNode document, - String operationName, + String? operationName, Map vars, Map typePolicies, Map> possibleTypes,