diff --git a/packages/ferry/lib/ferry_isolate.dart b/packages/ferry/lib/ferry_isolate.dart index 6b9d1e36..e1041967 100644 --- a/packages/ferry/lib/ferry_isolate.dart +++ b/packages/ferry/lib/ferry_isolate.dart @@ -99,8 +99,8 @@ class IsolateClient extends TypedLink { return _handleStreamCommand>( (port) => RequestCommand(port.sendPort, request), (response, sink) => sink.add(OperationResponse( - operationRequest: request, - linkException: response!.linkException, + operationRequest: response!.operationRequest, + linkException: response.linkException, graphqlErrors: response.graphqlErrors, dataSource: response.dataSource, extensions: response.extensions, diff --git a/packages/ferry/test/isolate/isolate_client_test.dart b/packages/ferry/test/isolate/isolate_client_test.dart index 0c81ea5f..e5f9d060 100644 --- a/packages/ferry/test/isolate/isolate_client_test.dart +++ b/packages/ferry/test/isolate/isolate_client_test.dart @@ -150,18 +150,26 @@ void main() { unawaited(expectLater( stream, emitsInOrder([ - OperationResponse( - data: GHumanWithArgsData((b) => b - ..human.id = '1' - ..human.name = 'Luke'), - dataSource: DataSource.Link, - operationRequest: req), - OperationResponse( - data: GHumanWithArgsData((b) => b - ..human.id = '2' - ..human.name = 'Bert'), - dataSource: DataSource.Cache, - operationRequest: req), + isA>() + .having( + (p) => p.data, + 'data', + GHumanWithArgsData((b) => b + ..human.id = '1' + ..human.name = 'Luke')) + .having((p) => p.linkException, 'linkException', isNull) + .having((p) => p.graphqlErrors, 'errors', isNull) + .having((p) => p.dataSource, 'source', DataSource.Link), + isA>() + .having( + (p) => p.data, + 'data', + GHumanWithArgsData((b) => b + ..human.id = '2' + ..human.name = 'Bert')) + .having((p) => p.linkException, 'linkException', isNull) + .having((p) => p.graphqlErrors, 'errors', isNull) + .having((p) => p.dataSource, 'source', DataSource.Cache), emitsDone, ]))); @@ -189,16 +197,21 @@ void main() { unawaited(expectLater( stream, emitsInOrder([ - OperationResponse( - data: GHumanWithArgsData((b) => b - ..human.id = '1' - ..human.name = 'Luke'), - dataSource: DataSource.Link, - operationRequest: req), - OperationResponse( - operationRequest: req, - data: null, - dataSource: DataSource.Cache), + isA>() + .having( + (p) => p.data, + 'data', + GHumanWithArgsData((b) => b + ..human.id = '1' + ..human.name = 'Luke')) + .having((p) => p.linkException, 'linkException', isNull) + .having((p) => p.graphqlErrors, 'errors', isNull) + .having((p) => p.dataSource, 'source', DataSource.Link), + isA>() + .having((p) => p.data, 'data', isNull) + .having((p) => p.linkException, 'linkException', isNull) + .having((p) => p.graphqlErrors, 'errors', isNull) + .having((p) => p.dataSource, 'source', DataSource.Cache), emitsDone, ])));