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:
parent
abd504412d
commit
339df7c934
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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"] }
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
@ -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 => ¤t[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), "")
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue