refactor queries

This commit is contained in:
2026-05-31 22:03:06 +02:00
parent 90a88c15dc
commit 7ffd06f446
13 changed files with 15 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
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<Vec<Typ>> {
let pool = ctx.data::<PgPool>()?;
let typen = Service::new(pool.clone()).typ_alle().await?;
Ok(typen)
}
}