use async_graphql::{ *, http::GraphiQLSource, }; use axum::{ response::{Html, IntoResponse}, routing::get, Router, }; use crate::{entity::{UserEntity, UserModel},}; pub struct Query; #[Object] impl Query { pub async fn user(&self, user_name: String) -> Result> { Ok(UserEntity::find_by_name(&user_name).await?) } pub async fn users(&self) -> Result> { Ok(UserEntity::find_all().await?) } }