Crate graphql_ws_client

Source
Expand description

§graphql-ws-client

graphql-ws-client implements asynchronous GraphQL-over-Websocket using the graphql-transport-ws protocol. It is websocket client, graphql client and async runtime agnostic. Built in support is provided for:

If you’d like to use another client or adding support should be trivial.

use graphql_ws_client::Client;
use std::future::IntoFuture;
use futures_lite::StreamExt;

let mut stream = Client::build(connection).subscribe(subscription).await?;

while let Some(response) = stream.next().await {
    // Do something with response
}

See the examples for more thorough usage details.

Modules§

graphql
This module contains traits that abstract over GraphQL implementations, allowing this library to be used with different GraphQL client libraries.
ws_stream_wasmws_stream_wasm
Integration with the ws_stream_wasm library

Structs§

Client
A GraphQL over Websocket client
ClientBuilder
Builder for Graphql over Websocket clients
ConnectionActor
The ConnectionActor contains the main loop for handling incoming & outgoing messages for a Client.
Subscription
A futures::Stream for a subscription.

Enums§

Error
Error type
Message
A websocket message

Traits§

Connection
Abstraction around a websocket connection.