Server class abstract

A server speaking Apollo's subscriptions-transport-ws protocol.

Handles the handshake, the keep-alive and the message bookkeeping. Subclass it and answer onConnect and onOperation; how events reach a subscriber is left to you, and so is the transport, which can be anything package:stream_channel can carry.

Constructors

Server(RemoteClient client, {Duration? keepAliveInterval})
Starts serving client, sending a keep-alive every keepAliveInterval if one is given.

Properties

client → RemoteClient
The client this server is talking to.
final
done → Future
Completes when the connection has been closed on either side.
no setter
hashCode → int
The hash code for this object.
no setterinherited
keepAliveInterval → Duration?
How often to send a keep-alive, or null to send none.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onConnect(RemoteClient client, [Map? connectionParams]) → FutureOr<bool>
Whether to accept the connection, given the client's connection_init payload.
onOperation(String? id, String query, [Map<String, dynamic>? variables, String? operationName]) → FutureOr<GraphQLResult>
Executes one operation and answers its result.
toString() → String
A string representation of this object.
inherited

Operators

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