2.0.0-alpha.26
This commit is contained in:
parent
ffb8120107
commit
34b6531576
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "A GraphQL server library implemented in Rust"
|
||||
|
@ -24,9 +24,9 @@ string_number = ["num-traits"]
|
|||
nightly = []
|
||||
|
||||
[dependencies]
|
||||
async-graphql-derive = { path = "derive", version = "2.0.0-alpha.25" }
|
||||
async-graphql-value = { path = "value", version = "2.0.0-alpha.25" }
|
||||
async-graphql-parser = { path = "parser", version = "2.0.0-alpha.25" }
|
||||
async-graphql-derive = { path = "derive", version = "2.0.0-alpha.26" }
|
||||
async-graphql-value = { path = "value", version = "2.0.0-alpha.26" }
|
||||
async-graphql-parser = { path = "parser", version = "2.0.0-alpha.26" }
|
||||
|
||||
async-stream = "0.3"
|
||||
async-trait = "0.1.30"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "graphql-benchmark"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "chat"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["Ivan Plesskih <terma95@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "simple"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["Ivan Plesskih <terma95@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-derive"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "Macros for async-graphql"
|
||||
|
@ -16,7 +16,7 @@ categories = ["network-programming", "asynchronous"]
|
|||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
async-graphql-parser = { path = "../parser", version = "2.0.0-alpha.25" }
|
||||
async-graphql-parser = { path = "../parser", version = "2.0.0-alpha.26" }
|
||||
proc-macro2 = "1.0.6"
|
||||
syn = { version = "1.0.20", features = ["full", "extra-traits"] }
|
||||
quote = "1.0.3"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-actix-web"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "async-graphql for actix-web"
|
||||
|
@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
|
|||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.25" }
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.26" }
|
||||
actix-web = { version = "3.0.2", default-features = false }
|
||||
actix-web-actors = "3.0.0"
|
||||
actix-http = "2.0.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-rocket"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["Daniel Wiesenberg <daniel@simplificAR.io>"]
|
||||
edition = "2018"
|
||||
description = "async-graphql for Rocket.rs"
|
||||
|
@ -14,7 +14,7 @@ keywords = ["futures", "async", "graphql", "rocket"]
|
|||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.25" }
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.26" }
|
||||
rocket = { git = "https://github.com/SergioBenitez/Rocket/", rev = "dc2c6ec", default-features = false } #TODO: Change to Cargo crate, when Rocket 0.5.0 is released
|
||||
log = "0.4.11"
|
||||
yansi = "0.5.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-tide"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["vkill <vkill.net@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "async-graphql for tide"
|
||||
|
@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
|
|||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.25" }
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.26" }
|
||||
tide = { version = "0.13.0", default-features = false, features = ["h1-server"] }
|
||||
async-trait = "0.1.36"
|
||||
serde_json = "1.0.56"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-warp"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "async-graphql for warp"
|
||||
|
@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
|
|||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.25" }
|
||||
async-graphql = { path = "../..", version = "2.0.0-alpha.26" }
|
||||
warp = { version = "0.2", default-features = false, features = ["websocket"] }
|
||||
futures = "0.3.0"
|
||||
bytes = "0.5.4"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-parser"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "GraphQL query parser for async-graphql"
|
||||
|
@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
|
|||
categories = ["network-programming", "asynchronous"]
|
||||
|
||||
[dependencies]
|
||||
async-graphql-value = { path = "../value", version = "2.0.0-alpha.25" }
|
||||
async-graphql-value = { path = "../value", version = "2.0.0-alpha.26" }
|
||||
pest = "2.1.3"
|
||||
pest_derive = "2.1.0"
|
||||
serde_json = "1.0.57"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "async-graphql-value"
|
||||
version = "2.0.0-alpha.25"
|
||||
version = "2.0.0-alpha.26"
|
||||
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
|
||||
edition = "2018"
|
||||
description = "GraphQL value for async-graphql"
|
||||
|
|
|
@ -425,9 +425,23 @@ impl<'de> serde::Deserializer<'de> for MapKeyDeserializer {
|
|||
NameDeserializer::new(self.key).deserialize_any(visitor)
|
||||
}
|
||||
|
||||
fn deserialize_enum<V>(
|
||||
self,
|
||||
name: &'static str,
|
||||
variants: &'static [&'static str],
|
||||
visitor: V,
|
||||
) -> Result<V::Value, DeserializerError>
|
||||
where
|
||||
V: Visitor<'de>,
|
||||
{
|
||||
self.key
|
||||
.into_deserializer()
|
||||
.deserialize_enum(name, variants, visitor)
|
||||
}
|
||||
|
||||
forward_to_deserialize_any! {
|
||||
bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string
|
||||
bytes byte_buf unit unit_struct seq tuple option newtype_struct enum
|
||||
bytes byte_buf unit unit_struct seq tuple option newtype_struct
|
||||
tuple_struct map struct identifier ignored_any
|
||||
}
|
||||
}
|
||||
|
@ -469,6 +483,7 @@ mod tests {
|
|||
use super::*;
|
||||
use crate::Number;
|
||||
use serde::Deserialize;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[test]
|
||||
fn test_deserializer() {
|
||||
|
@ -502,7 +517,7 @@ mod tests {
|
|||
let n: NewType = from_value(ConstValue::Number(100i32.into())).unwrap();
|
||||
assert_eq!(n.0, 100);
|
||||
|
||||
#[derive(Deserialize, Debug, Eq, PartialEq)]
|
||||
#[derive(Deserialize, Debug, Eq, PartialEq, Hash, Copy, Clone)]
|
||||
enum Enum {
|
||||
A,
|
||||
B,
|
||||
|
@ -513,6 +528,13 @@ mod tests {
|
|||
let n: Enum = from_value(ConstValue::Enum(Name::new("B"))).unwrap();
|
||||
assert_eq!(n, Enum::B);
|
||||
|
||||
let mut obj = BTreeMap::<Name, ConstValue>::new();
|
||||
obj.insert(Name::new("A"), ConstValue::Number(10.into()));
|
||||
obj.insert(Name::new("B"), ConstValue::Number(20.into()));
|
||||
let n: HashMap<Enum, i32> = from_value(ConstValue::Object(obj)).unwrap();
|
||||
assert_eq!(10, n[&Enum::A]);
|
||||
assert_eq!(20, n[&Enum::B]);
|
||||
|
||||
#[derive(Deserialize, Debug, Eq, PartialEq)]
|
||||
struct Struct {
|
||||
a: i32,
|
||||
|
|
Loading…
Reference in New Issue
Block a user