blob: 254dab6de7605517d010a26710348dada9d2b926 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 | use crate::{errors::AppError, graphql::types::user};
use async_graphql::{Context, Object};
pub struct Query;
#[Object]
impl Query {
    async fn api_version(&self) -> &'static str {
        "1.0"
    }
    /// Returns all the users
    async fn users<'ctx>(&self, ctx: &Context<'ctx>) -> Result<Option<Vec<user::User>>, String> {
        user::get_users(ctx).await
    }
}
 |