Add support for the query headers.

This commit is contained in:
2021-10-02 20:22:00 +01:00
parent 7ad04d7750
commit 333ec58bd2
7 changed files with 33 additions and 28 deletions
+5 -4
View File
@@ -28,7 +28,7 @@ var (
json = jsoniter.ConfigCompatibleWithStandardLibrary
)
type connHandler struct {
type GraphQL struct {
Endpoint string
HttpClient *http.Client
Log *logging.LogConfig
@@ -45,12 +45,13 @@ func pickGraphqlEndpoint() (graphqlEndpoint string) {
return graphqlEndpoint
}
func NewConnection() *connHandler {
return &connHandler{
func NewConnection() *GraphQL {
return &GraphQL{
Endpoint: pickGraphqlEndpoint(),
HttpClient: &http.Client{
Transport: &http2.Transport{
AllowHTTP: true,
DisableCompression: true,
AllowHTTP: true,
DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {
return net.Dial(network, addr)
},