-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #452 from instrumentisto/async-await-resolve-some-…
…todos Resolve some todos in async-await branch
- Loading branch information
Showing
32 changed files
with
373 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
#[macro_use] extern crate bencher; | ||
extern crate juniper; | ||
|
||
use bencher::Bencher; | ||
|
||
use juniper::{execute, RootNode, EmptyMutation, Variables}; | ||
use juniper::tests::model::Database; | ||
|
||
fn query_type_name(b: &mut Bencher) { | ||
let database = Database::new(); | ||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new()); | ||
|
||
let doc = r#" | ||
query IntrospectionQueryTypeQuery { | ||
__schema { | ||
queryType { | ||
name | ||
} | ||
} | ||
}"#; | ||
|
||
b.iter(|| execute(doc, None, &schema, &Variables::new(), &database)); | ||
} | ||
|
||
fn introspection_query(b: &mut Bencher) { | ||
let database = Database::new(); | ||
let schema = RootNode::new(&database, EmptyMutation::<Database>::new()); | ||
|
||
let doc = r#" | ||
query IntrospectionQuery { | ||
__schema { | ||
queryType { name } | ||
mutationType { name } | ||
subscriptionType { name } | ||
types { | ||
...FullType | ||
} | ||
directives { | ||
name | ||
description | ||
locations | ||
args { | ||
...InputValue | ||
} | ||
} | ||
} | ||
} | ||
fragment FullType on __Type { | ||
kind | ||
name | ||
description | ||
fields(includeDeprecated: true) { | ||
name | ||
description | ||
args { | ||
...InputValue | ||
} | ||
type { | ||
...TypeRef | ||
} | ||
isDeprecated | ||
deprecationReason | ||
} | ||
inputFields { | ||
...InputValue | ||
} | ||
interfaces { | ||
...TypeRef | ||
} | ||
enumValues(includeDeprecated: true) { | ||
name | ||
description | ||
isDeprecated | ||
deprecationReason | ||
} | ||
possibleTypes { | ||
...TypeRef | ||
} | ||
} | ||
fragment InputValue on __InputValue { | ||
name | ||
description | ||
type { ...TypeRef } | ||
defaultValue | ||
} | ||
fragment TypeRef on __Type { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
ofType { | ||
kind | ||
name | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
"#; | ||
|
||
b.iter(|| execute(doc, None, &schema, &Variables::new(), &database)); | ||
} | ||
|
||
benchmark_group!(queries, query_type_name, introspection_query); | ||
benchmark_main!(queries); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ impl User { | |
} | ||
} | ||
|
||
struct Query; | ||
struct Query; | ||
|
||
#[juniper::object(Context = Context)] | ||
impl Query { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "juniper" | ||
version = "0.14.0" | ||
version = "0.14.1" | ||
authors = [ | ||
"Magnus Hallin <[email protected]>", | ||
"Christoph Herzog <[email protected]>", | ||
|
@@ -33,20 +33,19 @@ default = [ | |
] | ||
|
||
[dependencies] | ||
juniper_codegen = { version = "0.14.0", path = "../juniper_codegen" } | ||
juniper_codegen = { version = "0.14.1", path = "../juniper_codegen" } | ||
|
||
async-trait = "0.1.16" | ||
chrono = { version = "0.4.0", optional = true } | ||
fnv = "1.0.3" | ||
futures-preview = { version = "=0.3.0-alpha.19", optional = true } | ||
indexmap = { version = "1.0.0", features = ["serde-1"] } | ||
serde = { version = "1.0.8" } | ||
serde_derive = { version = "1.0.2" } | ||
|
||
chrono = { version = "0.4.0", optional = true } | ||
serde_json = { version="1.0.2", optional = true } | ||
url = { version = "2", optional = true } | ||
uuid = { version = "0.7", optional = true } | ||
|
||
futures-preview = { version = "=0.3.0-alpha.19", optional = true } | ||
|
||
[dev-dependencies] | ||
bencher = "0.1.2" | ||
serde_json = { version = "1.0.2" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.