subscribe<T> method

  1. @override
Stream<GraphQLResponse<T>> subscribe<T>(
  1. GraphQLRequest<T> request, {
  2. void onEstablished()?,
})
inherited

Subscribes to the given request and returns the stream of response events. An optional onEstablished callback can be used to be alerted when the subscription has been successfully established with the server.

Any exceptions encountered during the subscription are added as errors to this stream.

Implementation

@override
Stream<GraphQLResponse<T>> subscribe<T>(
  GraphQLRequest<T> request, {
  void Function()? onEstablished,
}) {
  final event = SubscribeEvent(request, onEstablished);
  return _webSocketBloc(apiName: request.apiName).subscribe(event);
}