use crate::graphql::types::{position, 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>, #[graphql(desc = "Limit results")] limit: Option, #[graphql(desc = "Offset results")] offset: Option, ) -> Result>, String> { user::get_users(ctx, limit, offset).await } /// Returns all the positions async fn positions<'ctx>( &self, ctx: &Context<'ctx>, #[graphql(desc = "Limit results")] limit: Option, #[graphql(desc = "Offset results")] offset: Option, ) -> Result>, String> { position::get_positions(ctx, limit, offset).await } }