From 649671b2c580ff3f42dd13aaec834cab0d55a37b Mon Sep 17 00:00:00 2001 From: iamvigneshwars Date: Thu, 22 Feb 2024 11:44:10 +0000 Subject: [PATCH] WellNumber validation for crystal wells and other minor refactor --- backend/crystal_library/src/entities/mod.rs | 4 ++-- backend/crystal_library/src/graphql/crystal_wells_res.rs | 2 +- backend/crystal_library/src/graphql/mod.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/crystal_library/src/entities/mod.rs b/backend/crystal_library/src/entities/mod.rs index a519ea01..74d7efd7 100644 --- a/backend/crystal_library/src/entities/mod.rs +++ b/backend/crystal_library/src/entities/mod.rs @@ -1,4 +1,4 @@ -/// The crystal plates module +/// The table storing crystal plate information pub mod crystal_plates; -/// The crystal wells modules +/// The table storing crystal well information pub mod crystal_wells; diff --git a/backend/crystal_library/src/graphql/crystal_wells_res.rs b/backend/crystal_library/src/graphql/crystal_wells_res.rs index 2f233bac..f26ac1af 100644 --- a/backend/crystal_library/src/graphql/crystal_wells_res.rs +++ b/backend/crystal_library/src/graphql/crystal_wells_res.rs @@ -68,7 +68,7 @@ impl CrystalWellsMutation { &self, ctx: &Context<'_>, plate_id: Uuid, - well_number: i16, + #[graphql(validator(minimum = 1, maximum = 288))] well_number: i16, ) -> async_graphql::Result { let operator_id = subject_authorization!("xchemlab.crystal_library.write_crystal_wells", ctx).await?; diff --git a/backend/crystal_library/src/graphql/mod.rs b/backend/crystal_library/src/graphql/mod.rs index 63474c39..77b81771 100644 --- a/backend/crystal_library/src/graphql/mod.rs +++ b/backend/crystal_library/src/graphql/mod.rs @@ -1,6 +1,6 @@ -/// The cyrstal plates resolver module +/// A collection of resolvers relating to crystal plates pub mod crystal_plates_res; -/// The cyrstal wells resolver module +/// A collection of resolvers relating to crystal wells pub mod crystal_wells_res; use async_graphql::{EmptySubscription, MergedObject, Schema, SchemaBuilder};