total rewrite to interface handling; not complete but it compiles

This commit is contained in:
Ben Kraft
2020-07-16 13:28:43 -07:00
parent af4a765a32
commit cf7136ca65
33 changed files with 712 additions and 173 deletions
+10 -6
View File
@@ -8,16 +8,20 @@ import (
"github.com/Khan/genql/graphql"
)
type User struct {
MyName *string
}
type User1 struct {
TheirName *string `json:"theirName"`
}
type getUserResponse struct {
User *struct {
TheirName *string `json:"theirName"`
} `json:"user"`
User *User1 `json:"user"`
}
type getViewerResponse struct {
Viewer struct {
MyName *string
} `json:"viewer"`
Viewer User `json:"viewer"`
}
func getViewer(ctx context.Context, client *graphql.Client) (*getViewerResponse, error) {