summaryrefslogtreecommitdiff
path: root/src/graphql/query.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-08-23 22:07:47 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-08-23 22:07:47 +0200
commitcb1aa9668a967fe875e716469ccf936ed8693ad3 (patch)
treeff06888ed9d2a3a3b7fe2a05d18d80e801db6e15 /src/graphql/query.rs
parentecb99e08531ff4d22e1a2204989e848347b3a756 (diff)
Filter positions by user id
Diffstat (limited to 'src/graphql/query.rs')
-rw-r--r--src/graphql/query.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/graphql/query.rs b/src/graphql/query.rs
index a875d25..3d72b2e 100644
--- a/src/graphql/query.rs
+++ b/src/graphql/query.rs
@@ -23,9 +23,10 @@ impl Query {
async fn positions<'ctx>(
&self,
ctx: &Context<'ctx>,
+ #[graphql(desc = "Filter by user id")] user_id: Option<i32>,
#[graphql(desc = "Limit results")] limit: Option<i64>,
#[graphql(desc = "Offset results")] offset: Option<i64>,
) -> Result<Option<Vec<position::Position>>, String> {
- position::get_positions(ctx, limit, offset).await
+ position::get_positions(ctx, user_id, limit, offset).await
}
}