use async_graphql::{Context, FieldResult, Object}; use sqlx::postgres::PgPool; use crate::domain::typ::{model::Typ, service::Service}; #[derive(Default)] pub struct TypQuery {} #[Object(extends)] impl TypQuery { async fn typen(&self, ctx: &Context<'_>) -> FieldResult> { let pool = ctx.data::()?; let typen = Service::new(pool.clone()).typ_alle().await?; Ok(typen) } }