1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! # graphql-ws-client
//!
//! graphql-ws-client implements asynchronous GraphQL-over-Websocket using the
//! [graphql-transport-ws protocol][protocol]. It is websocket client, graphql
//! client _and_ async runtime agnostic. Built in support is provided for:
//!
//! - [Cynic][cynic] & [Graphql-Client][graphql-client] GraphQL clients.
//! - [async-tungstenite][async-tungstenite], [tokio-tungstenite][tokio-tungstenite]
//! & [ws-stream-wasm][ws-stream-wasm] Websocket Clients .
//! - Any async runtime.
//!
//! If you'd like to use another client or adding support should be trivial.
//!
//! ```rust
//! use graphql_ws_client::Client;
//! use std::future::IntoFuture;
//! use futures_lite::StreamExt;
//! # async fn example() -> Result<(), graphql_ws_client::Error> {
//! # let connection = graphql_ws_client::__doc_utils::Conn;
//! # let subscription = graphql_ws_client::__doc_utils::Subscription;
//!
//! let mut stream = Client::build(connection).subscribe(subscription).await?;
//!
//! while let Some(response) = stream.next().await {
//! // Do something with response
//! }
//! # Ok(())
//! # }
//! ```
//!
//! See the [examples][examples] for more thorough usage details.
//!
//! [protocol]: https://github.com/graphql/graphql-over-http/blob/main/rfcs/GraphQLOverWebSocket.md
//! [cynic]: https://cynic-rs.dev
//! [graphql-client]: https://github.com/graphql-rust/graphql-client
//! [async-tungstenite]: https://github.com/sdroege/async-tungstenite
//! [tokio-tungstenite]: https://github.com/snapview/tokio-tungstenite
//! [ws-stream-wasm]: https://github.com/najamelan/ws_stream_wasm
//! [examples]: https://codeberg.org/obmarg/graphql-ws-client/src/branch/main/examples
/// Integration with the [ws_stream_wasm][1] library
///
/// [1]: https://docs.rs/ws_stream/latest/ws_stream
// docsrs wants to enable all the tungstenite features
// which won't compile - so we disable this module on docsrs
pub use *;
pub use Error;