change queries

This commit is contained in:
2026-05-25 19:26:24 +02:00
parent e6a011f159
commit e0f78a12e1
12 changed files with 1375 additions and 1160 deletions

View File

@@ -8,17 +8,13 @@ pub struct HerstellerQuery {}
#[Object(extends)]
impl HerstellerQuery {
async fn hersteller<'a>(
&self,
ctx: &'a Context<'_>,
id: uuid::Uuid,
) -> FieldResult<Hersteller> {
async fn hersteller(&self, ctx: &Context<'_>, id: uuid::Uuid) -> FieldResult<Hersteller> {
let pool = ctx.data::<PgPool>()?;
let row = Hersteller::read_one(pool, &id).await?;
Ok(row)
}
async fn alle_hersteller<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Hersteller>> {
async fn alle_hersteller(&self, ctx: &Context<'_>) -> FieldResult<Vec<Hersteller>> {
let pool = ctx.data::<PgPool>()?;
let rows = Hersteller::read_all(pool).await?;
Ok(rows)