graphql_ws_client_old_protocol/lib.rs
1//! # graphql-ws-client
2//!
3//! graphql-ws-client implements asynchronous GraphQL-over-Websocket using the
4//! [graphql-transport-ws protocol][protocol]. It tries to be websocket client,
5//! graphql client _and_ async executor agnostic and provides built in support
6//! for:
7//!
8//! - [Cynic][cynic] & [Graphql-Client][graphql-client] GraphQL clients.
9//! - [async-tungstenite][async-tungstenite] & [ws-stream-wasm][ws-stream-wasm] Websocket Clients .
10//! - The [async-std][async-std] & [tokio][tokio] async runtimes.
11//!
12//! If you'd like to use another client or runtime adding support should
13//! hopefully be trivial.
14//!
15//! [protocol]: https://github.com/enisdenjo/graphql-ws/blob/HEAD/PROTOCOL.md
16//! [cynic]: https://cynic-rs.dev
17//! [graphql-client]: https://github.com/graphql-rust/graphql-client
18//! [async-tungstenite]: https://github.com/sdroege/async-tungstenite
19//! [async-std]: https://async.rs/
20//! [tokio]: https://tokio.rs/
21//! [ws-stream-wasm]: https://github.com/najamelan/ws_stream_wasm
22
23#![warn(missing_docs)]
24
25mod client;
26mod logging;
27mod protocol;
28
29pub mod graphql;
30pub mod websockets;
31
32#[cfg(feature = "ws_stream_wasm")]
33mod wasm;
34#[cfg(feature = "ws_stream_wasm")]
35pub use wasm::*;
36
37#[cfg(feature = "async-tungstenite")]
38mod native;
39#[cfg(feature = "async-tungstenite")]
40pub use native::*;
41
42pub use client::{AsyncWebsocketClient, AsyncWebsocketClientBuilder, Error, SubscriptionStream};
43
44/// A websocket client for the cynic graphql crate
45#[cfg(feature = "cynic")]
46pub type CynicClient<WsMessage> = AsyncWebsocketClient<graphql::Cynic, WsMessage>;
47/// A websocket client builder for the cynic graphql crate
48#[cfg(feature = "cynic")]
49pub type CynicClientBuilder = AsyncWebsocketClientBuilder<graphql::Cynic>;
50
51/// A websocket client for the graphql_client graphql crate
52#[cfg(feature = "graphql_client")]
53pub type GraphQLClientClient<WsMessage> = AsyncWebsocketClient<graphql::GraphQLClient, WsMessage>;
54/// A websocket client builder for the graphql_client graphql crate
55#[cfg(feature = "graphql_client")]
56pub type GraphQLClientClientBuilder = AsyncWebsocketClientBuilder<graphql::GraphQLClient>;