Merge branch 'master' of https://github.com/async-graphql/async-graphql
This commit is contained in:
commit
78c1bd2652
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "async-graphql"
|
name = "async-graphql"
|
||||||
version = "1.15.1"
|
version = "1.15.2"
|
||||||
authors = ["sunli <scott_s829@163.com>"]
|
authors = ["sunli <scott_s829@163.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
description = "A GraphQL server library implemented in Rust"
|
description = "A GraphQL server library implemented in Rust"
|
||||||
|
|
|
@ -5,7 +5,7 @@ use chrono::{DateTime, TimeZone, Utc};
|
||||||
/// Implement the DateTime<Utc> scalar
|
/// Implement the DateTime<Utc> scalar
|
||||||
///
|
///
|
||||||
/// The input/output is a string in RFC3339 format.
|
/// The input/output is a string in RFC3339 format.
|
||||||
#[Scalar(internal, name = "DateTime")]
|
#[Scalar(internal, name = "DateTimeUtc")]
|
||||||
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 {
|
||||||
|
|
|
@ -55,10 +55,10 @@ mod tests {
|
||||||
assert_eq!(<NaiveTime as Type>::type_name(), "NaiveTime");
|
assert_eq!(<NaiveTime as Type>::type_name(), "NaiveTime");
|
||||||
assert_eq!(<NaiveTime as Type>::qualified_type_name(), "NaiveTime!");
|
assert_eq!(<NaiveTime as Type>::qualified_type_name(), "NaiveTime!");
|
||||||
|
|
||||||
assert_eq!(<DateTime::<Utc> as Type>::type_name(), "DateTime");
|
assert_eq!(<DateTime::<Utc> as Type>::type_name(), "DateTimeUtc");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
<DateTime::<Utc> as Type>::qualified_type_name(),
|
<DateTime::<Utc> as Type>::qualified_type_name(),
|
||||||
"DateTime!"
|
"DateTimeUtc!"
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(<Uuid as Type>::type_name(), "UUID");
|
assert_eq!(<Uuid as Type>::type_name(), "UUID");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user