total rewrite to interface handling; not complete but it compiles
This commit is contained in:
+35
-8
@@ -1,8 +1,35 @@
|
||||
type Response struct {
|
||||
User *struct {
|
||||
Emails []string `json:"emails"`
|
||||
EmailsOrNull []string `json:"emailsOrNull"`
|
||||
EmailsWithNulls []*string `json:"emailsWithNulls"`
|
||||
EmailsWithNullsOrNull []*string `json:"emailsWithNullsOrNull"`
|
||||
} `json:"user"`
|
||||
}
|
||||
package test
|
||||
|
||||
// Code generated by github.com/Khan/genql, DO NOT EDIT.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Khan/genql/graphql"
|
||||
)
|
||||
|
||||
type QueryWithSlicesResponse struct {
|
||||
User *User `json:"user"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Emails []string `json:"emails"`
|
||||
EmailsOrNull []string `json:"emailsOrNull"`
|
||||
EmailsWithNulls []*string `json:"emailsWithNulls"`
|
||||
EmailsWithNullsOrNull []*string `json:"emailsWithNullsOrNull"`
|
||||
}
|
||||
|
||||
func QueryWithSlices(client *graphql.Client) (*QueryWithSlicesResponse, error) {
|
||||
var retval QueryWithSlicesResponse
|
||||
err := client.MakeRequest(context.Background(), `
|
||||
query QueryWithSlices {
|
||||
user {
|
||||
emails
|
||||
emailsOrNull
|
||||
emailsWithNulls
|
||||
emailsWithNullsOrNull
|
||||
}
|
||||
}
|
||||
`, &retval, nil)
|
||||
return &retval, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user