func (c *Client) Raw(r Raw, out interface{}) (interface{}, error) {
	req, err := c.buildRequest(r)
	if err != nil {
		return nil, err
	}
	if r.Header == nil {
		r.Header = make(http.Header)
	}
	r.Header.Add("Content-Type", "application/json")
	req.Header = r.Header
	resp, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	defer func() {
		if cerr := resp.Body.Close(); cerr != nil {
			fmt.Fprintln(os.Stderr, cerr)  
		}
	}()
	var gqlResponse Response
	if out != nil {
		gqlResponse.Data = out
	}
	dec := json.NewDecoder(resp.Body)
	if err = dec.Decode(&gqlResponse); err != nil {
		return nil, err
	}
	if len(gqlResponse.Errors) != 0 {
		err = gqlResponse.Errors
	}
	return gqlResponse.Data, err
}
Raw executes GraphQL query against GraphQL remote
package client
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"net/url"
	"os"
	"regexp"
	"strings"
)
var (
	multipleSpaces = regexp.MustCompile(`[\s\p{Zs}]{2,}`)
)
type Client struct {
	http.Client
	Endpoint string
}
type Raw struct {
	Query string `json:"query,omitempty"`
	Variables map[string]interface{} `json:"variables,omitempty"`
	OperationName string `json:"operationName,omitempty"`
	Header http.Header `json:"-"`
	Method string `json:"-"`
}
func (r Raw) values() (url.Values, error) {
	if r.Query == "" {
		return nil, errors.New("query cannot be empty")
	}
	r.Query = minifyQuery(r.Query)
	values := make(url.Values)
	values.Add("query", r.Query)
	if len(r.Variables) != 0 {
		b, err := json.Marshal(r.Variables)
		if err != nil {
			return nil, err
		}
		values.Add("variables", string(b))
	}
	if r.OperationName != "" {
		values.Add("operationName", r.OperationName)
	}
	return values, nil
}
func minifyQuery(q string) string {
	q = strings.Replace(q, "\n", "", -1)
	q = strings.TrimSpace(q)
	q = multipleSpaces.ReplaceAllString(q, " ")
	return q
}
func (c *Client) buildRequest(r Raw) (*http.Request, error) {
	b, err := json.Marshal(r)
	if err != nil {
		return nil, err
	}
	url, err := url.Parse(c.Endpoint)
	if err != nil || c.Endpoint == "" {
		if c.Endpoint == "" {
			err = fmt.Errorf("endpoint cannot be empty")
		}
		return nil, err
	}
	meth := r.Method
	if meth == "" {
		meth = "POST"
	}
	return http.NewRequest(
		meth,
		url.String(),
		bytes.NewBuffer(b),
	)
}