fluentci_graphql/schema/
envhub.rs

1use std::sync::{Arc, Mutex};
2
3use super::objects::envhub::Envhub;
4use async_graphql::{Context, Error, Object};
5use fluentci_common::envhub::envhub as common_envhub;
6use fluentci_core::deps::Graph;
7
8#[derive(Default, Clone)]
9pub struct EnvhubQuery;
10
11#[Object]
12impl EnvhubQuery {
13    async fn envhub(&self, ctx: &Context<'_>) -> Result<Envhub, Error> {
14        let graph = ctx.data::<Arc<Mutex<Graph>>>().unwrap();
15        let envhub = common_envhub(graph.clone(), true)?;
16        Ok(Envhub::from(envhub))
17    }
18}