Possible API improvements to juniper_hyper
#1102
Labels
enhancement
Improvement of existing features or bugfix
k::api
Related to API (application interface)
k::integration
Related to integration with third-party libraries or systems
lib::hyper
Related to `hyper` crate integration
While working on #1101 , I thought of a couple more possible improvements.
For one, I think it would be useful to make
parse_req
andexecute_request[_sync]
public. With that, it would be possible to inspect theGraphQLRequest
before executing it (e.g. for logging). It's even questionable whether the conveniencegraphql[_sync]
functions are even necessary then, as they just call these two other functions.All functions taking a
Request<Body>
should also be able to take aRequest<String>
. The body is converted to a string internally anyway and users of the library might already have aResponse<String>
. This also helps with users inspecting the request beforehand, given thatString
is much easier to use thanhyper::Body
. However, extending the API like that is a bit harder than #1101 as we still want to supportBody
.The text was updated successfully, but these errors were encountered: