Release 4.0.7

async-graphql@4.0.7
async-graphql-actix-web@4.0.7
async-graphql-axum@4.0.7
async-graphql-derive@4.0.7
async-graphql-parser@4.0.7
async-graphql-poem@4.0.7
async-graphql-rocket@4.0.7
async-graphql-tide@4.0.7
async-graphql-value@4.0.7
async-graphql-warp@4.0.7

Generated by cargo-workspaces
This commit is contained in:
Sunli 2022-08-09 14:57:10 +08:00
parent abd504412d
commit 339df7c934
14 changed files with 55 additions and 2887 deletions

View File

@ -10,7 +10,7 @@ license = "MIT/Apache-2.0"
name = "async-graphql"
readme = "README.md"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[features]
apollo_persisted_queries = ["lru", "sha2"]
@ -28,9 +28,9 @@ tracing = ["tracinglib", "tracing-futures"]
unblock = ["blocking"]
[dependencies]
async-graphql-derive = { path = "derive", version = "4.0.6" }
async-graphql-parser = { path = "parser", version = "4.0.6" }
async-graphql-value = { path = "value", version = "4.0.6" }
async-graphql-derive = { path = "derive", version = "4.0.7" }
async-graphql-parser = { path = "parser", version = "4.0.7" }
async-graphql-value = { path = "value", version = "4.0.7" }
async-stream = "0.3.0"
async-trait = "0.1.48"

View File

@ -9,13 +9,13 @@ keywords = ["futures", "async", "graphql"]
license = "MIT/Apache-2.0"
name = "async-graphql-derive"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[lib]
proc-macro = true
[dependencies]
async-graphql-parser = { path = "../parser", version = "4.0.6" }
async-graphql-parser = { path = "../parser", version = "4.0.7" }
Inflector = "0.11.4"
darling = "0.14.0"

View File

@ -100,6 +100,8 @@ You can pass multiple generic types to `params()`, separated by a comma.
If any part of your input is considered sensitive and you wish to redact it, you can mark it with `secret` directive. For example:
```rust
# extern crate async_graphql;
# use async_graphql::*;
#[derive(InputObject)]
pub struct CredentialsInput {
username: String,

View File

@ -9,10 +9,10 @@ keywords = ["futures", "async", "graphql"]
license = "MIT/Apache-2.0"
name = "async-graphql-actix-web"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
actix = "0.13.0"
actix-http = "3.1.0"

View File

@ -9,10 +9,10 @@ keywords = ["futures", "async", "graphql", "axum"]
license = "MIT/Apache-2.0"
name = "async-graphql-axum"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
async-trait = "0.1.51"
axum = { version = "0.5.1", features = ["ws", "headers"] }

View File

@ -9,10 +9,10 @@ keywords = ["futures", "async", "graphql", "poem"]
license = "MIT/Apache-2.0"
name = "async-graphql-poem"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
futures-util = { version = "0.3.0", default-features = false }
poem = { version = "1.3.0", features = ["websocket"] }

View File

@ -9,10 +9,10 @@ keywords = ["futures", "async", "graphql", "rocket"]
license = "MIT/Apache-2.0"
name = "async-graphql-rocket"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
rocket = { version = "0.5.0-rc.2", default-features = false }
serde = "1.0.126"

View File

@ -9,14 +9,14 @@ keywords = ["futures", "async", "graphql"]
license = "MIT/Apache-2.0"
name = "async-graphql-tide"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[features]
default = ["websocket"]
websocket = ["tide-websockets"]
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
async-trait = "0.1.48"
futures-util = "0.3.0"

View File

@ -9,10 +9,10 @@ keywords = ["futures", "async", "graphql"]
license = "MIT/Apache-2.0"
name = "async-graphql-warp"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql = { path = "../..", version = "4.0.6", default-features = false }
async-graphql = { path = "../..", version = "4.0.7", default-features = false }
futures-util = { version = "0.3.0", default-features = false, features = [
"sink",

View File

@ -9,16 +9,14 @@ keywords = ["futures", "async", "graphql"]
license = "MIT/Apache-2.0"
name = "async-graphql-parser"
repository = "https://github.com/async-graphql/async-graphql"
version = "4.0.6"
version = "4.0.7"
[dependencies]
async-graphql-value = { path = "../value", version = "4.0.6" }
async-graphql-value = { path = "../value", version = "4.0.7" }
pest = "2.2.1"
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.64"
[dev-dependencies]
pest_generator = "2.1.3"
prettyplease = "0.1.18"
[build-dependencies]
pest_generator = "2.2.1"
proc-macro2 = "1.0.37"
syn = "1.0.99"

29
parser/build.rs Normal file
View File

@ -0,0 +1,29 @@
use std::{error::Error, fs};
const PREAMBLE: &str = "\
//! This is @generated code, do not edit by hand.
//! See `graphql.pest` and `tests/codegen.rs`.
#![allow(unused_attributes)]
use super::GraphQLParser;
";
fn main() -> Result<(), Box<dyn Error>> {
generated_code()?;
println!("cargo:rerun-if-changed=src/graphql.pest");
Ok(())
}
fn generated_code() -> Result<(), Box<dyn Error>> {
let input = r###"
#[derive(Parser)]
#[grammar = r#"graphql.pest"#]
struct GraphQLParser;
"###
.parse::<proc_macro2::TokenStream>()
.unwrap();
let tokens = pest_generator::derive_parser(input, false);
let new = tokens.to_string();
let code = format!("{}\n{}", PREAMBLE, &new);
fs::write("./src/parse/generated.rs", code).unwrap();
Ok(())
}

File diff suppressed because one or more lines are too long

View File

@ -3,50 +3,3 @@
//!
//! To avoid that, let's just dump generated code to string into this
//! repository, and add a test that checks that the code is fresh.
use std::fs;
const PREAMBLE: &str = "\
//! This is @generated code, do not edit by hand.
//! See `graphql.pest` and `tests/codegen.rs`.
#![allow(unused_attributes)]
use super::GraphQLParser;
";
#[test]
fn generated_code_is_fresh() {
let input = r###"
#[derive(Parser)]
#[grammar = r#"graphql.pest"#]
struct GraphQLParser;
"###
.parse::<proc_macro2::TokenStream>()
.unwrap();
let tokens = pest_generator::derive_parser(input, false);
let current =
String::from_utf8(fs::read("./src/parse/generated.rs").unwrap_or_default()).unwrap();
let normalized = normalize(match current.len() > PREAMBLE.len() {
true => &current[PREAMBLE.len()..],
false => current.as_str(),
});
let new = tokens.to_string();
let is_up_to_date = normalized == normalize(&new);
if is_up_to_date {
return;
}
let code = format!("{}\n{}", PREAMBLE, reformat(&new));
fs::write("./src/parse/generated.rs", code).unwrap();
panic!("Generated code in the repository is outdated, updating...");
}
fn reformat(code: &str) -> String {
let syntax_tree = syn::parse_str(code).unwrap();
prettyplease::unparse(&syntax_tree)
}
fn normalize(code: &str) -> String {
code.replace(|c: char| c.is_ascii_whitespace() || "{},".contains(c), "")
}

View File

@ -1,6 +1,6 @@
[package]
name = "async-graphql-value"
version = "4.0.6"
version = "4.0.7"
authors = ["sunli <scott_s829@163.com>", "Koxiaet"]
edition = "2021"
description = "GraphQL value for async-graphql"