async-graphql/tests/input_validators.rs

15 lines
318 B
Rust
Raw Normal View History

use async_graphql::validators::StringMinLength;
use async_graphql::*;
#[async_std::test]
pub async fn test_string_min_length() {
struct Query1;
#[Object]
impl Query1 {
2020-05-27 02:25:59 +00:00
async fn test(&self, #[arg(validator(StringMinLength(length = "6")))] _id: String) -> bool {
true
}
}
}