refactor Ulid und Dataloader
This commit is contained in:
@@ -3,14 +3,14 @@ use async_graphql::{ComplexObject, Context, FieldResult, SimpleObject};
|
||||
use crate::{
|
||||
dataloader::LoaderContext,
|
||||
domain::{gruppe::model::Gruppe, rolle::model::Rolle},
|
||||
scalar::Id,
|
||||
scalar::Ulid,
|
||||
};
|
||||
|
||||
#[derive(sqlx::FromRow, SimpleObject)]
|
||||
#[graphql(complex)]
|
||||
pub struct Benutzer {
|
||||
/// Die UUID eines Benutzers
|
||||
pub id: Id,
|
||||
/// Die ULid eines Benutzers
|
||||
pub id: Ulid,
|
||||
|
||||
/// Die Kennung des Benutzers
|
||||
pub kennung: String,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
use crate::scalar::Id;
|
||||
use async_graphql::InputObject;
|
||||
|
||||
use crate::scalar::Ulid;
|
||||
|
||||
#[derive(InputObject)]
|
||||
pub struct BenutzerCreateInput {
|
||||
// #[graphql(validator(min_length = 6, max_length = 8))]
|
||||
pub kennung: String,
|
||||
pub vorname: String,
|
||||
pub nachname: String,
|
||||
pub rollen: Option<Vec<Id>>,
|
||||
pub gruppen: Option<Vec<Id>>,
|
||||
pub rollen: Option<Vec<Ulid>>,
|
||||
pub gruppen: Option<Vec<Ulid>>,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use async_graphql::{ComplexObject, Enum, SimpleObject};
|
||||
use sqlx::Type;
|
||||
|
||||
use crate::scalar::{Id, Time};
|
||||
use crate::scalar::{Time, Ulid};
|
||||
|
||||
/// Aus welcher Quelle die Gruppe stammt.
|
||||
#[derive(Enum, Clone, Debug, Eq, Copy, PartialEq, Type)]
|
||||
@@ -21,7 +21,7 @@ pub enum Herkunft {
|
||||
#[graphql(complex)]
|
||||
pub struct GruppeAnsicht {
|
||||
/// Die UUID einer Gruppe
|
||||
pub id: Id,
|
||||
pub id: Ulid,
|
||||
|
||||
/// Der Gruppenname
|
||||
pub gruppenname: String,
|
||||
|
||||
Reference in New Issue
Block a user