From ce519ea06f0a16c7cc5268067f9408d9997257a7 Mon Sep 17 00:00:00 2001 From: Joseph Herlant Date: Mon, 24 Jun 2019 09:03:18 -0700 Subject: [PATCH] Export the client endpoint --- graphql.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/graphql.go b/graphql.go index 05c29b7..c0845cf 100644 --- a/graphql.go +++ b/graphql.go @@ -44,7 +44,7 @@ import ( // Client is a client for interacting with a GraphQL API. type Client struct { - endpoint string + Endpoint string httpClient *http.Client useMultipartForm bool @@ -60,7 +60,7 @@ type Client struct { // NewClient makes a new Client capable of making GraphQL requests. func NewClient(endpoint string, opts ...ClientOption) *Client { c := &Client{ - endpoint: endpoint, + Endpoint: endpoint, Log: func(string) {}, } for _, optionFunc := range opts { @@ -113,7 +113,7 @@ func (c *Client) runWithJSON(ctx context.Context, req *Request, resp interface{} gr := &graphResponse{ Data: resp, } - r, err := http.NewRequest(http.MethodPost, c.endpoint, &requestBody) + r, err := http.NewRequest(http.MethodPost, c.Endpoint, &requestBody) if err != nil { return err } @@ -184,7 +184,7 @@ func (c *Client) runWithPostFields(ctx context.Context, req *Request, resp inter gr := &graphResponse{ Data: resp, } - r, err := http.NewRequest(http.MethodPost, c.endpoint, &requestBody) + r, err := http.NewRequest(http.MethodPost, c.Endpoint, &requestBody) if err != nil { return err }