make config file optional

This commit is contained in:
Ben Kraft
2020-03-27 16:37:48 -07:00
parent 6caa3fc6c4
commit c536227d32
4 changed files with 24 additions and 16 deletions
+3
View File
@@ -43,6 +43,8 @@ func getViewer(ctx context.Context, client *graphql.Client) (*getViewerResponse,
graphqlClient := graphql.NewClient("https://example.com/graphql", http.DefaultClient)
viewerResp, _ := getViewer(context.Background(), graphqlClient)
fmt.Println("you are", *viewerResp.Viewer.MyName)
//go:generate go run github.com/Khan/genql
```
For a complete working example, see `example/`.
@@ -64,6 +66,7 @@ Config options:
- file locations (queries, generated, schema (or get via HTTP))
- use ctx or not, including complexities of how Khan uses context
- HTTP calling convention (is there enough variation to matter?)
- proper config/arguments setup (e.g. with [viper](https://github.com/spf13/viper)
Other:
- error-checking/validation/etc. everywhere