Skip to content

Possible API improvements to juniper_hyper #1102

@LukasKalbertodt

Description

@LukasKalbertodt

While working on #1101 , I thought of a couple more possible improvements.

For one, I think it would be useful to make parse_req and execute_request[_sync] public. With that, it would be possible to inspect the GraphQLRequest before executing it (e.g. for logging). It's even questionable whether the convenience graphql[_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 a Request<String>. The body is converted to a string internally anyway and users of the library might already have a Response<String>. This also helps with users inspecting the request beforehand, given that String is much easier to use than hyper::Body. However, extending the API like that is a bit harder than #1101 as we still want to support Body.

Metadata

Metadata

Labels

enhancementImprovement of existing features or bugfixk::apiRelated to API (application interface)k::integrationRelated to integration with third-party libraries or systemslib::hyperRelated to `hyper` crate integration

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy