From fc51ff9e22a809e257ae92f12272f1dbcb31f594 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 22 Aug 2024 22:25:57 +0200 Subject: Add position type and query on it --- src/graphql/query.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/graphql/query.rs') diff --git a/src/graphql/query.rs b/src/graphql/query.rs index 0e19771..a875d25 100644 --- a/src/graphql/query.rs +++ b/src/graphql/query.rs @@ -1,4 +1,4 @@ -use crate::{errors::AppError, graphql::types::user}; +use crate::graphql::types::{position, user}; use async_graphql::{Context, Object}; pub struct Query; @@ -18,4 +18,14 @@ impl Query { ) -> 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 + } } -- cgit v1.2.3-18-g5258