examples/warp_async: update dependency paths
This commit is contained in:
parent
746bdb5aae
commit
ef3720cb67
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
|
||||
|
||||
[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"
|
||||
env_logger = "0.6.2"
|
||||
warp = "0.1.19"
|
||||
futures-preview = { version = "0.3.0-alpha.18", features = ["nightly", "async-await", "compat"] }
|
||||
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 {}
|
||||
|
||||
#[derive(juniper::GraphQLEnum, Clone, Copy)]
|
||||
enum UserKind {
|
||||
Admin,
|
||||
User,
|
||||
Guest,
|
||||
}
|
||||
|
||||
struct User {
|
||||
id: i32,
|
||||
kind: UserKind,
|
||||
name: String,
|
||||
}
|
||||
|
||||
|
@ -24,6 +32,10 @@ impl User {
|
|||
self.id
|
||||
}
|
||||
|
||||
fn kind(&self) -> UserKind {
|
||||
self.kind
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
&self.name
|
||||
}
|
||||
|
@ -41,6 +53,7 @@ impl Query {
|
|||
vec![
|
||||
User{
|
||||
id: 1,
|
||||
kind: UserKind::Admin,
|
||||
name: "user1".into(),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -91,6 +91,7 @@ Juniper has not reached 1.0 yet, thus some API instability should be expected.
|
|||
|
||||
#![doc(html_root_url = "https://docs.rs/juniper/0.13.1")]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
#![cfg_attr(feature = "async", feature(async_await, async_closure))]
|
||||
|
||||
#[doc(hidden)]
|
||||
|
|
Loading…
Reference in a new issue