change queries
This commit is contained in:
@@ -8,13 +8,13 @@ pub struct TypQuery {}
|
||||
|
||||
#[Object(extends)]
|
||||
impl TypQuery {
|
||||
async fn typen<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Typ>> {
|
||||
async fn typen(&self, ctx: &Context<'_>) -> FieldResult<Vec<Typ>> {
|
||||
let pool = ctx.data::<PgPool>()?;
|
||||
let rows = Typ::read_all(pool).await?;
|
||||
Ok(rows)
|
||||
}
|
||||
|
||||
async fn typ<'a>(&self, ctx: &'a Context<'_>, id: Id) -> FieldResult<Typ> {
|
||||
async fn typ(&self, ctx: &Context<'_>, id: Id) -> FieldResult<Typ> {
|
||||
let pool = ctx.data::<PgPool>()?;
|
||||
let row = Typ::read_one(pool, &id).await?;
|
||||
Ok(row)
|
||||
|
||||
Reference in New Issue
Block a user