Skip to content

Commit 58ed885

Browse files
authored
Merge pull request #407 from qwandor/rustls
2 parents 143c948 + 2813502 commit 58ed885

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88
## Unreleased
99

1010
- The `variables_derives` now trims whitespace from individual derivation traits.
11+
- The new `reqwest-rustls` feature works like the `reqwest` feature but with
12+
`rustls` rather than `native-tls`.
1113

1214
## 0.10.0 - 2021-07-04
1315

graphql_client/Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ edition = "2018"
1111
homepage = "https://github.com/graphql-rust/graphql-client"
1212
readme = "../README.md"
1313

14+
[package.metadata.docs.rs]
15+
features = ["reqwest"]
16+
1417
[dependencies]
1518
serde = { version = "^1.0.78", features = ["derive"] }
1619
serde_json = "1.0"
1720

1821
# Optional dependencies
1922
graphql_query_derive = { path = "../graphql_query_derive", version = "0.10.0", optional = true }
20-
reqwest = { version = "^0.11", features = ["json"], optional = true }
23+
reqwest-crate = { package = "reqwest", version = "^0.11", features = ["json"], default-features = false, optional = true }
2124

2225
[features]
2326
default = ["graphql_query_derive"]
24-
reqwest-blocking = ["reqwest/blocking"]
27+
reqwest = ["reqwest-crate", "reqwest-crate/default-tls"]
28+
reqwest-rustls = ["reqwest-crate", "reqwest-crate/rustls-tls"]
29+
reqwest-blocking = ["reqwest-crate/blocking"]

graphql_client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ extern crate graphql_query_derive;
2323
#[doc(hidden)]
2424
pub use graphql_query_derive::*;
2525

26-
#[cfg(any(feature = "reqwest", feature = "reqwest-blocking"))]
26+
#[cfg(any(feature = "reqwest", feature = "reqwest-rustls", feature = "reqwest-blocking"))]
2727
pub mod reqwest;
2828

2929
use serde::{Deserialize, Serialize};

graphql_client/src/reqwest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
//! A concrete client implementation over HTTP with reqwest.
22
33
use crate::GraphQLQuery;
4+
use reqwest_crate as reqwest;
45

56
/// Use the provided reqwest::Client to post a GraphQL request.
6-
#[cfg(feature = "reqwest")]
7+
#[cfg(any(feature = "reqwest", feature = "reqwest-rustls"))]
78
pub async fn post_graphql<Q: GraphQLQuery, U: reqwest::IntoUrl>(
89
client: &reqwest::Client,
910
url: U,

0 commit comments

Comments
 (0)