SubscriptionStream<T> class

Converts a GraphQL subscription Stream into a SignalResult-compatible stream for use with StreamToSignalResultAdapter.

final stream = SubscriptionStream<Product>(
  client: client,
  document: subscriptionDocument,
  parser: (data) => $Product.fromJson(data['productUpdated']),
);

final sr = StreamToSignalResultAdapter<Product>.adapt(stream.toResultStream());

Constructors

SubscriptionStream({required GraphQLClient client, required String document, required T parser(Map<String, dynamic> data), Map<String, dynamic> variables = const {}})

Properties

client → GraphQLClient
final
document String
final
hashCode int
The hash code for this object.
no setterinherited
parser → T Function(Map<String, dynamic> data)
final
rawStream Stream<QueryResult<Object?>>
The raw GraphQL subscription stream.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
variables Map<String, dynamic>
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toResultStream() Stream<Result<T, AppFailure>>
A parsed stream of Result values.
toSignalResult() SignalResult<T>
A SignalResult that updates on each subscription event.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited