We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the issue Subscription stream minnsin transformer to transform error into query result object https://github.com/zino-app/graphql-flutter/blob/beta/packages/graphql/lib/src/core/query_manager.dart#L68
In case if there is an error in request the subscription stream does not handle errors correctly to match the query flow.
In case of error simulation in tests
when( mockHttpClient.send(any), ).thenThrow(Error());
you'll get an error
package:gql_http_link/src/link.dart 157:7 HttpLink._executeRequest package:gql_http_link/src/link.dart 97:32 HttpLink.request ===== asynchronous gap =========================== dart:async _AsyncStarStreamController.addError package:gql_http_link/src/link.dart HttpLink.request ===== asynchronous gap =========================== dart:async _asyncErrorWrapperHelper package:gql_link/src/link.dart 125:36 _LinkChain.request.<fn>.<fn> package:gql_link/src/link.dart 126:8 _LinkChain.request package:graphql/src/core/query_manager.dart 68:17 QueryManager.subscribe ===== asynchronous gap =========================== dart:async _StreamImpl.listen package:graphql_flutter_bloc/src/subscription/bloc.dart 87:42 SubscriptionBloc.mapEventToState ===== asynchronous gap =========================== dart:async _StreamImpl.listen package:bloc/src/bloc.dart 240:7 Bloc._bindEventsToStates package:bloc/src/bloc.dart 22:5 new Bloc package:graphql_flutter_bloc/src/subscription/bloc.dart 18:9 new SubscriptionBloc test/subscription_test.dart 21:9 new TestSubscriptionBloc test/subscription_test.dart 49:30 main.<fn>.<fn> ServerException(originalException: Instance of 'Error', parsedResponse: null)
Expected behavior Transforms error into QueryResult object for consistency.
QueryResult
Temp workaround
subscription = client.subscribe(event.options).handleError(Object error) { QueryResult queryResult = QueryResult(source: QueryResultSource.network); queryResult.exception = coalesceErrors( exception: queryResult.exception, linkException: translateFailure(error), ); // do with query result whatever you need });
The text was updated successfully, but these errors were encountered:
closed by #768
Sorry, something went wrong.
🎉 This issue has been resolved in version 4.0.0-beta.5 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
🎉 This issue has been resolved in version 4.0.0 🎉
micimize
Successfully merging a pull request may close this issue.
Describe the issue
Subscription stream minnsin transformer to transform error into query result object
https://github.com/zino-app/graphql-flutter/blob/beta/packages/graphql/lib/src/core/query_manager.dart#L68
In case if there is an error in request the subscription stream does not handle errors correctly to match the query flow.
In case of error simulation in tests
you'll get an error
Expected behavior
Transforms error into
QueryResult
object for consistency.Temp workaround
The text was updated successfully, but these errors were encountered: