diff --git a/graphql_client/Cargo.toml b/graphql_client/Cargo.toml index 3ced39c07..8687f9771 100644 --- a/graphql_client/Cargo.toml +++ b/graphql_client/Cargo.toml @@ -16,6 +16,15 @@ serde = { version = "^1.0.78", features = ["derive"] } serde_json = "1.0" doc-comment = "0.3.1" +[dependencies.reqwest] +version = "0.9.16" +optional = true + +[dependencies.futures-preview] +version = "0.3.0-alpha.16" +optional = true +features = ["compat"] + [dependencies.futures] version = "0.1" optional = true @@ -54,6 +63,7 @@ version = "0.9.16" version = "0.2.43" [features] +native = ["reqwest", "futures-preview"] web = [ "futures", "js-sys", diff --git a/graphql_client/src/lib.rs b/graphql_client/src/lib.rs index 795851a0b..6d57041ba 100644 --- a/graphql_client/src/lib.rs +++ b/graphql_client/src/lib.rs @@ -2,6 +2,7 @@ //! //! The main interface to this library is the custom derive that generates modules from a GraphQL query and schema. See the docs for the [`GraphQLQuery`] trait for a full example. +#![feature(async_await)] #![deny(missing_docs)] #![deny(rust_2018_idioms)] #![deny(warnings)] @@ -15,6 +16,8 @@ pub use graphql_query_derive::*; use serde::*; +#[cfg(feature = "native")] +pub mod native; #[cfg(feature = "web")] pub mod web;