pub async fn connect() -> Result<AsyncWebsocketClient<GraphQLClient, Message>>
Examples found in repository?
examples/tensorswap_order_update_all.rs (line 10)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
async fn main() -> Result<()> {
    let client = match connect().await {
        Ok(client) => client,
        Err(e) => {
            eprintln!("Error connecting to websocket: {}", e);
            return Ok(());
        }
    };

    let mut stream =
        subscribe::<TensorswapOrderUpdateAllQuery>(client, TensorswapOrderUpdateAllVariables {})
            .await?;

    while let None = stream.next().await {
        // let data = event?.data;
        // let response: TensorswapOrderUpdateAllResponse =
        //     data.unwrap().tswap_order_update_all.unwrap();
        dbg!(&stream.next().await);
    }

    Ok(())
}