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