Skip to main content

blokli_client/api/v1/graphql/
graph.rs

1use super::{accounts::Account, channels::Channel, schema};
2
3#[derive(cynic::QueryFragment, Debug)]
4#[cynic(graphql_type = "SubscriptionRoot")]
5pub struct SubscribeGraph {
6    pub opened_channel_graph_updated: OpenedChannelsGraphEntry,
7}
8
9/// One edge in the open-channel graph.
10///
11/// The graph subscription emits an initial set of open-channel entries and then later channel changes. Consumers
12/// should merge updates by [`Channel::concrete_channel_id`](super::channels::Channel::concrete_channel_id).
13#[derive(cynic::QueryFragment, Debug, Clone)]
14#[cfg_attr(feature = "serde", derive(serde::Serialize))]
15pub struct OpenedChannelsGraphEntry {
16    /// Channel represented by this graph edge.
17    pub channel: Channel,
18    /// Destination account for the channel.
19    pub destination: Account,
20    /// Source account for the channel.
21    pub source: Account,
22}