examples/warp_async: update dependency paths
This commit is contained in:
parent
57ecd4b471
commit
3d9fc8e347
3 changed files with 18 additions and 2 deletions
|
@ -7,11 +7,13 @@ edition = "2018"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
juniper = { git = "https://github.com/graphql-rust/juniper", branch = "async-await", features = ["async"] }
|
|
||||||
juniper_warp = { git = "https://github.com/graphql-rust/juniper", branch = "async-await", features = ["async"] }
|
|
||||||
log = "0.4.8"
|
log = "0.4.8"
|
||||||
env_logger = "0.6.2"
|
env_logger = "0.6.2"
|
||||||
warp = "0.1.19"
|
warp = "0.1.19"
|
||||||
futures-preview = { version = "0.3.0-alpha.18", features = ["nightly", "async-await", "compat"] }
|
futures-preview = { version = "0.3.0-alpha.18", features = ["nightly", "async-await", "compat"] }
|
||||||
reqwest = "0.9.19"
|
reqwest = "0.9.19"
|
||||||
|
|
||||||
|
juniper_codegen = { git = "https://github.com/graphql-rust/juniper", branch = "async-await", features = ["async"] }
|
||||||
|
juniper = { git = "https://github.com/graphql-rust/juniper", branch = "async-await", features = ["async"] }
|
||||||
|
juniper_warp = { git = "https://github.com/graphql-rust/juniper", branch = "async-await", features = ["async"] }
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,16 @@ struct Context {
|
||||||
}
|
}
|
||||||
impl juniper::Context for Context {}
|
impl juniper::Context for Context {}
|
||||||
|
|
||||||
|
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
||||||
|
enum UserKind {
|
||||||
|
Admin,
|
||||||
|
User,
|
||||||
|
Guest,
|
||||||
|
}
|
||||||
|
|
||||||
struct User {
|
struct User {
|
||||||
id: i32,
|
id: i32,
|
||||||
|
kind: UserKind,
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +32,10 @@ impl User {
|
||||||
self.id
|
self.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn kind(&self) -> UserKind {
|
||||||
|
self.kind
|
||||||
|
}
|
||||||
|
|
||||||
fn name(&self) -> &str {
|
fn name(&self) -> &str {
|
||||||
&self.name
|
&self.name
|
||||||
}
|
}
|
||||||
|
@ -41,6 +53,7 @@ impl Query {
|
||||||
vec![
|
vec![
|
||||||
User{
|
User{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
kind: UserKind::Admin,
|
||||||
name: "user1".into(),
|
name: "user1".into(),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
|
@ -90,6 +90,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
|
||||||
*/
|
*/
|
||||||
#![doc(html_root_url = "https://docs.rs/juniper/0.14.0")]
|
#![doc(html_root_url = "https://docs.rs/juniper/0.14.0")]
|
||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
|
|
||||||
#![cfg_attr(feature = "async", feature(async_await, async_closure))]
|
#![cfg_attr(feature = "async", feature(async_await, async_closure))]
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
|
|
Loading…
Reference in a new issue