misc bits of documentation

This commit is contained in:
Ben Kraft
2021-03-25 14:13:14 -07:00
parent 937540d244
commit f136758db4
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -69,13 +69,13 @@ See [DESIGN.md](DESIGN.md) for documentation of major design decisions in this l
(+) denotes things we further need before recommending anyone else use this in prod
Generated code:
- add flag(s) to make a field use a pointer (for optionality or perf)
- add flag(s) to make a field use a pointer (for optionality or perf; see DESIGN)
- redo support for interfaces, unions, fragments (see DESIGN)
- (optional) collapsing -- should be able to have `mutation { myMutation { error { code } } }` just return `(code string, err error)`
Config options:
- (+) proper config/arguments setup (e.g. with [viper](https://github.com/spf13/viper))
- make client/context wiring a bit more documented and usable by humans (and allow imports for the client-getter)
- (+) improve client_getter to be more usable (and document it), or flag it out for now.
- get schema via HTTP (perhaps even via GraphQL introspection)
- send hash rather than full query
- whether names should be exported
+5 -5
View File
@@ -50,7 +50,7 @@ type client struct {
// NewClient returns a Client which makes requests to the given endpoint,
// suitable for most users.
//
// The client makes requests to the given GraphQL endpoint using standard
// The client makes POST requests to the given GraphQL endpoint using standard
// GraphQL HTTP-over-JSON transport. It will use the given http client, or
// http.DefaultClient if a nil client is passed.
//
@@ -73,7 +73,7 @@ type response struct {
Errors gqlerror.List `json:"errors"`
}
func (client *client) MakeRequest(ctx context.Context, query string, retval interface{}, variables map[string]interface{}) error {
func (c *client) MakeRequest(ctx context.Context, query string, retval interface{}, variables map[string]interface{}) error {
body, err := json.Marshal(payload{
Query: query,
Variables: variables,
@@ -83,8 +83,8 @@ func (client *client) MakeRequest(ctx context.Context, query string, retval inte
}
req, err := http.NewRequest(
client.method,
client.endpoint,
c.method,
c.endpoint,
bytes.NewReader(body))
if err != nil {
return err
@@ -93,7 +93,7 @@ func (client *client) MakeRequest(ctx context.Context, query string, retval inte
if ctx != nil {
req = req.WithContext(ctx)
}
resp, err := client.httpClient.Do(req)
resp, err := c.httpClient.Do(req)
if err != nil {
return err
}