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
use async_graphql::Object;

#[derive(Default)]
pub struct Meta;

#[Object]
impl Meta {
    /// Vector version
    async fn version_string(&self) -> String {
        crate::get_version()
    }

    /// Hostname
    async fn hostname(&self) -> Option<String> {
        crate::get_hostname().ok()
    }
}

#[derive(Default)]
pub struct MetaQuery;

#[Object]
impl MetaQuery {
    async fn meta(&self) -> Meta {
        Meta
    }
}