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:
- Cynic & Graphql-Client GraphQL clients.
- async-tungstenite, tokio-tungstenite & ws-stream-wasm Websocket Clients .
- Any async runtime.
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_ wasm ws_stream_wasm
- Integration with the ws_stream_wasm library
Structs§
- Client
- A GraphQL over Websocket client
- Client
Builder - Builder for Graphql over Websocket clients
- Connection
Actor - The
ConnectionActor
contains the main loop for handling incoming & outgoing messages for a Client. - Subscription
- A
futures::Stream
for a subscription.
Enums§
Traits§
- Connection
- Abstraction around a websocket connection.