hasura / go-graphql-client

Package graphql provides a GraphQL client implementation.
MIT License
396 stars 91 forks source link

Allow to set custom *http.Client in SubscriptionClient #7

Closed Difrex closed 2 years ago

Difrex commented 3 years ago

Hello.

This patch adds support to set up a custom *http.Client. This needs, for example, if you are using an oauth2 authorization.

jeanlucmongrain commented 3 years ago

this PR is outdated, as this feature already exists

Difrex commented 3 years ago

I don't see this feature in the subscriptions client.

hgiasac commented 3 years ago

@bclermont means we can set custom websocket client with this method https://github.com/hasura/go-graphql-client/blob/408d1f23326fe1fb2ab649fbb2531d4c390bf64a/subscription.go#L136

Therefore should we need to add this option, or just improve the docs about how to customize the websocket client

hgiasac commented 2 years ago

IMO there are more configurations that can be customized in the WebSocket client, not only http.Client So it's better to expose the WebsocketHandler, and we just need to rewrite the constructor for custom client https://github.com/hasura/go-graphql-client#custom-websocket-client

Thank you for your contribution. However we can close this PR