use chrono::prelude::*; use juniper::graphql_object; use uuidv7::Uuid; use crate::api::{scalars, Context}; #[derive(Clone, Debug)] pub struct Directory { pub id: Uuid, pub created_at: DateTime, pub updated_at: Option>, } #[graphql_object(context = Context)] impl Directory { fn id(&self) -> scalars::Uuid { scalars::Uuid(self.id) } fn path(&self) -> String { format!("{}", self.id) } fn created_at(&self) -> DateTime { self.created_at } fn updated_at(&self) -> Option> { self.updated_at } }