shopify_draft_proxy/proxy/upstream_dispatch
Driver that fetches a GraphQL request upstream when the proxy is in
LiveHybrid mode. Mirrors the commit-driver split:
fetch_sync/4— Erlang. Synchronous; returns aResultdirectly.fetch_async/4— JavaScript. Returns aPromise(Result(...)).
Both share the same send-shaped seam (built from
upstream_client.send_*) so tests can inject a fake transport
without dragging gleam_httpc/gleam_fetch into the assertion shape.
Values
pub fn fetch_async(
origin: String,
path: String,
body: String,
inbound_headers: dict.Dict(String, String),
send: fn(request.Request(String)) -> promise.Promise(
Result(commit.HttpOutcome, commit.CommitTransportError),
),
) -> promise.Promise(
Result(commit.HttpOutcome, commit.CommitTransportError),
)
Erlang-only synchronous driver. The injected send lets tests fake
the HTTP transport.
JS-only async driver. Promise-based to thread through fetch.