GraphQlClient class
Wrapper around GraphQLClient
used to implement middleware capabilities.
Constructors
Properties
-
authExceptionHandler
↔ Future<
void> Function(AuthorizationException)? -
Callback, called when middleware catches AuthorizationException.
getter/setter pair
-
client
→ Future<
GraphQLClient> -
Returns
GraphQLClient
with or without token header authorization.no setter - connected → RxBool
-
Indicator whether this GraphQlClient is successfully connected to the
endpoint.
final
- guard → Mutex
-
Mutex guarding the client.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token ↔ AccessTokenSecret?
-
Authorization bearer token.
getter/setter pair
Methods
-
addListener(
void handler(Exception?)) → void -
Registers the provided
handler
to listen to Exceptions happening with the queries. -
clearCache(
) → void - Clears the cache attached to the client.
-
disconnect(
) → void - Disconnects the client and disposes the connection.
-
mutate(
MutationOptions< Object?> options, {RawClientOptions? raw, Exception onException(Map<String, dynamic> )?}) → Future<QueryResult< Object?> > -
Resolves a single mutation according to the
MutationOptions
specified and returns a Future which resolves with theQueryResult
or throws an Exception. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post<
T> (dynamic data, {Options? options, String? operationName, Exception onException(Map< String, dynamic> )?, void onSendProgress(int, int)?}) → Future<Response< T> > -
Makes an HTTP POST request with an exposed
onSendProgress
. -
query(
QueryOptions< Object?> options, [Exception handleException(Map<String, dynamic> )?]) → Future<QueryResult< Object?> > -
Resolves a single query according to the
QueryOptions
specified and returns a Future which resolves with theQueryResult
or throws an Exception. -
reconnect(
) → Future< void> - Reconnects the client right away if the token mismatch is detected.
-
removeListener(
void handler(Exception?)) → void -
Unregisters the provided
handler
from listening to Exceptions happening with the queries. -
subscribe(
SubscriptionOptions< Object?> options, {FutureOr<Version?> ver()?}) → Stream<QueryResult< Object?> > -
Subscribes to a GraphQL subscription according to the
options
specified. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- maxReconnectPeriodMillis → const int
- Maximum possible period of exponential backoff reconnection.
- minReconnectPeriodMillis → const int
- Starting period of exponential backoff reconnection.
- timeout → const Duration
- Duration considered as a network timeout.