Update datetime.rs
This commit is contained in:
parent
996c6ea497
commit
643b540575
@ -9,9 +9,7 @@ use chrono::{DateTime, Utc};
|
|||||||
impl ScalarType for DateTime<Utc> {
|
impl ScalarType for DateTime<Utc> {
|
||||||
fn parse(value: Value) -> InputValueResult<Self> {
|
fn parse(value: Value) -> InputValueResult<Self> {
|
||||||
match &value {
|
match &value {
|
||||||
Value::String(s) => s
|
Value::String(s) => Ok(s.parse::<DateTime<Utc>>()?),
|
||||||
.parse::<DateTime<Utc>>()
|
|
||||||
.map_err(|_| InputValueError::ExpectedType(value)),
|
|
||||||
_ => Err(InputValueError::ExpectedType(value)),
|
_ => Err(InputValueError::ExpectedType(value)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user