add support for enums

This commit is contained in:
Ben Kraft
2020-04-10 18:16:32 -07:00
parent 9510470937
commit 7ab06dfd30
7 changed files with 203 additions and 35 deletions
+6 -6
View File
@@ -8,18 +8,18 @@ import (
"github.com/Khan/genql/graphql"
)
type getViewerResponse struct {
Viewer struct {
MyName *string
} `json:"viewer"`
}
type getUserResponse struct {
User *struct {
TheirName *string `json:"theirName"`
} `json:"user"`
}
type getViewerResponse struct {
Viewer struct {
MyName *string
} `json:"viewer"`
}
func getViewer(ctx context.Context, client *graphql.Client) (*getViewerResponse, error) {
var retval getViewerResponse
err := client.MakeRequest(ctx, `