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:
- 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§
- 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§
- A GraphQL over Websocket client
- Builder for Graphql over Websocket clients
- The
ConnectionActor
contains the main loop for handling incoming & outgoing messages for a Client. - A
futures::Stream
for a subscription.
Enums§
- Error type
- A websocket message
Traits§
- Abstrction around a websocket connection.