-
Notifications
You must be signed in to change notification settings - Fork 169
Description
Hi. I'm trying to use the post_graphql function with the "reqwest" feature enabled. Even though my project depends on both this library and "reqwest", I'm hitting the "two different versions of crate `reqwest`" error. As such, I can't construct a reqwest::Client that post_graphql accepts.
Suggested Solution
Could we add a re-export of the "reqwest" crate when the feature is enabled?
I.e, in "src/graphql_client/reqwest.rs":
#[cfg(feature = "reqwest")]
pub use reqwest_crate as reqwest;This should allow downstream users to do the following:
// Use the exact version of reqwest that graphql_client expects.
use graphql_client::reqwest::{Client, post_graphql};
let client = Client::new();
// This should now work.
post_graphql(&client, ...);For now, I'm manually copying the function implementation into my project to bypass the type mismatch, but a re-export would be much cleaner and more user-friendly.
I'd be happy to implement this fix and make a PR myself, but let me know if there's a different approach you'd prefer, or if you think I'm missing something obvious that'd let me use post_graphql without relying on my work-around.
In any case, thanks for the library!