fluentci_graphql/schema/
proto.rs

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