refactoring delete models
This commit is contained in:
@@ -10,17 +10,6 @@ pub struct HerstellerQuery {
|
||||
|
||||
#[Object(extends)]
|
||||
impl HerstellerQuery {
|
||||
// #[graphql(external)]
|
||||
// async fn id(&self) -> &i32 {
|
||||
// &self.id
|
||||
// }
|
||||
|
||||
// async fn modell<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Modell>> {
|
||||
// let pool = ctx.data::<PgPool>().unwrap();
|
||||
// let rows = Modell::read_by_typ(pool, &self.id).await?;
|
||||
// Ok(rows)
|
||||
// }
|
||||
|
||||
async fn alle_hersteller<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Hersteller>> {
|
||||
let pool = ctx.data::<PgPool>()?;
|
||||
let rows = Hersteller::read_all(pool).await?;
|
||||
|
||||
@@ -10,16 +10,6 @@ pub struct TypQuery {
|
||||
|
||||
#[Object(extends)]
|
||||
impl TypQuery {
|
||||
// #[graphql(external)]
|
||||
// async fn id(&self) -> &i32 {
|
||||
// &self.id
|
||||
// }
|
||||
// async fn modell<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Modell>> {
|
||||
// let pool = ctx.data::<PgPool>().unwrap();
|
||||
// let rows = Modell::read_by_typ(pool, &self.id).await?;
|
||||
// Ok(rows)
|
||||
// }
|
||||
|
||||
async fn typen<'a>(&self, ctx: &'a Context<'_>) -> FieldResult<Vec<Typ>> {
|
||||
let pool = ctx.data::<PgPool>()?;
|
||||
let rows = Typ::read_all(pool).await?;
|
||||
@@ -31,11 +21,4 @@ impl TypQuery {
|
||||
let row = Typ::read_one(pool, &id).await?;
|
||||
Ok(row)
|
||||
}
|
||||
|
||||
// #[graphql(entity)]
|
||||
// async fn find_typ_by_id<'a>(&self, ctx: &'a Context<'_>, id: i32) -> FieldResult<Typ> {
|
||||
// let pool = ctx.data::<PgPool>().unwrap();
|
||||
// let row = Typ::read_one(pool, &id).await?;
|
||||
// Ok(row)
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user