-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blocking API and change code structure to re-use reqwest::Client #19
base: master
Are you sure you want to change the base?
Conversation
- Configure CI to publish crate version on master branch build arthurkhlghatyan#8 - Add missing fields for GraphQLErrorMessage struct arthurkhlghatyan#4: Still need to specify path field - Rollback tokio to v0.2 for now
- Final struct representation arthurkhlghatyan#4 - Upgrade to tokio V1 but still doesn't work arthurkhlghatyan#5
Why remove |
I agree with @fewensa this brings breaking changes to API, aside from that documentation doesn't seem to be updated. Need some time to check it out. |
Client::builder() | ||
.timeout(Duration::from_secs(5)) | ||
.build() | ||
.unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use unwrap. you can use map_err
convert to GraphQLError and throw it. the unwrap will be panic.
like this
Line 42 in 7b6bf56
.map_err(|e| GraphQLError::with_text(format!("Can not create client: {:?}", e)))?, |
Client::builder() | ||
.default_headers(header_map) | ||
.build() | ||
.unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
} | ||
} | ||
|
||
pub fn new_with_headers(endpoint: impl AsRef<str>, headers: HashMap<&str, &str>) -> Self { | ||
pub fn new_with_headers(endpoint: &'a str, headers: HashMap<&str, &str>) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my mistake, I'm missing something here. header_map
still exists. but there I suggest you still use impl AsRef<str>
. because do this you can call this function use &str/String and or support AsRef<str>
struct
Please merge master branch, I think the development branch is not the main branch, nor will it be maintained for a long time, we should mainly maintain the master branch |
@@ -33,14 +33,14 @@ pub enum GraphQLErrorPathParam { | |||
} | |||
|
|||
impl GraphQLError { | |||
pub fn with_text(message: impl AsRef<str>) -> Self { | |||
pub fn from_str(message: &str) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge master branch
No description provided.