use async_graphql::{Context, FieldResult, Object}; use sqlx::postgres::PgPool; use crate::domain::benutzer::{model::Benutzer, service::Service}; #[derive(Default)] pub struct BenutzerQuery {} #[Object(extends)] impl BenutzerQuery { // async fn rolle<'a>(&self, ctx: &'a Context<'_>, id: Id) -> FieldResult { // let pool = ctx.data::()?; // let row = Modell::read_one(pool, &id).await?; // Ok(row) // } async fn benutzer_alle<'a>(&self, ctx: &'a Context<'_>) -> FieldResult> { let pool = ctx.data::()?; let benutzer = Service::new(pool.clone()).alle_benutzer().await?; Ok(benutzer) } }