github-community-projects / graphql-client

A Ruby library for declaring, composing and executing GraphQL queries
MIT License
45 stars 219 forks source link

Customizable HTTP client #36

Closed jhass closed 4 months ago

jhass commented 4 months ago

It would be nice to be able to fully customize the HTTP client, for example to take advantage of something like async-http.

This should be simple enough to implement by pulling the direct calls to Net::HTTP out into another object, thus declaring a contract that this library needs from an HTTP client, then allowing to inject another than the default instance of this object (adapter pattern).

jhass commented 4 months ago

Ah sorry, for the noise, I wasn't reading the docs carefully enough.

One is supposed to implement their own version of https://github.com/github-community-projects/graphql-client/blob/master/lib/graphql/client/http.rb and pass that to the execute option instead.