This commit is contained in:
sunli 2020-05-16 21:16:30 +08:00
parent c16d239b65
commit b31639e3e9
9 changed files with 27 additions and 32 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql"
version = "1.12.9"
version = "1.12.10"
authors = ["sunli <scott_s829@163.com>"]
edition = "2018"
description = "The GraphQL server library implemented by rust"
@ -17,8 +17,8 @@ readme = "README.md"
default = ["bson", "uuid", "url", "chrono-tz"]
[dependencies]
async-graphql-parser = { path = "async-graphql-parser", version = "0.4.0" }
async-graphql-derive = { path = "async-graphql-derive", version = "1.12.9" }
async-graphql-parser = { path = "async-graphql-parser", version = "0.5.0" }
async-graphql-derive = { path = "async-graphql-derive", version = "1.12.10" }
anyhow = "1.0.26"
thiserror = "1.0.11"
async-trait = "0.1.30"

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-actix-web"
version = "1.4.8"
version = "1.4.10"
authors = ["sunli <scott_s829@163.com>"]
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 = "1.12.9" }
async-graphql = { path = "..", version = "1.12.10" }
actix-web = "2.0.0"
actix-web-actors = "2.0.0"
actix = "0.9.0"

View File

@ -127,6 +127,8 @@ where
Subscription: SubscriptionType + Send + Sync + 'static,
{
fn handle(&mut self, data: Bytes, ctx: &mut Self::Context) {
ctx.text(std::str::from_utf8(&data).ok().unwrap_or_default());
if let Ok(text) = std::str::from_utf8(&data) {
ctx.text(text);
}
}
}

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-derive"
version = "1.12.9"
version = "1.12.10"
authors = ["sunli <scott_s829@163.com>"]
edition = "2018"
description = "Macros for async-graphql"
@ -16,7 +16,7 @@ categories = ["network-programming", "asynchronous"]
proc-macro = true
[dependencies]
async-graphql-parser = { path = "../async-graphql-parser", version = "0.4.0" }
async-graphql-parser = { path = "../async-graphql-parser", version = "0.5.0" }
proc-macro2 = "1.0.6"
syn = { version = "1.0.20", features = ["full", "extra-traits"] }
quote = "1.0.3"

View File

@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
categories = ["network-programming", "asynchronous"]
[dependencies]
async-graphql = { path = "..", version = "1.12.9" }
async-graphql = { path = "..", version = "1.12.10" }
lambda_http = { git = "https://github.com/awslabs/aws-lambda-rust-runtime" }
futures = "0.3.0"
async-trait = "0.1.30"

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-parser"
version = "0.4.0"
version = "0.5.0"
authors = ["sunli <scott_s829@163.com>"]
edition = "2018"
description = "GraphQL query parser for async-graphql"

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-tide"
version = "1.4.9"
version = "1.4.10"
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 = "1.12.9" }
async-graphql = { path = "..", version = "1.12.10" }
tide = "0.8"
async-trait = "0.1.30"
serde_json = "1.0.51"

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-warp"
version = "1.4.9"
version = "1.4.10"
authors = ["sunli <scott_s829@163.com>"]
edition = "2018"
description = "async-graphql for warp"
@ -13,7 +13,7 @@ keywords = ["futures", "async", "graphql"]
categories = ["network-programming", "asynchronous"]
[dependencies]
async-graphql = { path = "..", version = "1.12.9" }
async-graphql = { path = "..", version = "1.12.10" }
warp = "0.2.2"
futures = "0.3.0"
bytes = "0.5.4"

View File

@ -175,14 +175,11 @@ where
select! {
bytes = srx.next() => {
if let Some(bytes) = bytes {
if tx
.send(Message::text(
String::from_utf8(bytes.to_vec()).unwrap()
))
.await
.is_err()
{
return;
if let Ok(text) = String::from_utf8(bytes.to_vec()) {
if tx.send(Message::text(text)).await.is_err()
{
return;
}
}
} else {
return;
@ -203,8 +200,8 @@ where
})
},
).map(|reply| {
warp::reply::with_header(reply, "Sec-WebSocket-Protocol", "graphql-ws")
})
warp::reply::with_header(reply, "Sec-WebSocket-Protocol", "graphql-ws")
})
.boxed()
}
@ -240,14 +237,10 @@ where
select! {
bytes = srx.next() => {
if let Some(bytes) = bytes {
if tx
.send(Message::text(
String::from_utf8(bytes.to_vec()).unwrap()
))
.await
.is_err()
{
return;
if let Ok(text) = String::from_utf8(bytes.to_vec()) {
if tx.send(Message::text(text)).await.is_err() {
return;
}
}
} else {
return;