@@ -2,7 +2,6 @@ package graphql
22
33import (
44 "bytes"
5- "compress/gzip"
65 "context"
76 "encoding/json"
87 "errors"
@@ -214,7 +213,6 @@ func (c *Client) doHttpRequest(ctx context.Context, body io.ReadSeeker) *rawGrap
214213 }
215214
216215 request .Header .Add ("Content-Type" , "application/json" )
217- request .Header .Add ("Accept-Encoding" , "gzip" )
218216
219217 if c .requestModifier != nil {
220218 c .requestModifier (request )
@@ -338,28 +336,6 @@ func (c *Client) decodeRawGraphQLResponse(
338336) * rawGraphQLResult {
339337 var r io.Reader = resp .Body
340338
341- if resp .Header .Get ("Content-Encoding" ) == "gzip" {
342- gr , err := gzip .NewReader (r )
343- if err != nil {
344- return & rawGraphQLResult {
345- request : req ,
346- requestBody : reqBody ,
347- Errors : Errors {
348- newError (
349- ErrJsonDecode ,
350- fmt .Errorf ("problem trying to create gzip reader: %w" , err ),
351- ),
352- },
353- }
354- }
355-
356- defer func () {
357- _ = gr .Close ()
358- }()
359-
360- r = gr
361- }
362-
363339 // copy the response reader for debugging
364340 var respReader * bytes.Reader
365341
@@ -760,7 +736,9 @@ const (
760736 queryOperation operationType = iota
761737 mutationOperation
762738 // subscriptionOperation // Unused.
739+ )
763740
741+ const (
764742 ErrRequestError = "request_error"
765743 ErrJsonEncode = "json_encode_error"
766744 ErrJsonDecode = "json_decode_error"
0 commit comments