I think there should be something like if res.StatusCode != http.StatusOK { after res, err := c.httpClient.Do(r) In case the server returns a 400 or a 500, the current code returns: 2018/01/17 17:44:37 << {"errors":[{}]} graphql: