total rewrite to interface handling; not complete but it compiles
This commit is contained in:
+31
-6
@@ -1,6 +1,31 @@
|
||||
type Response struct {
|
||||
User *struct {
|
||||
ID string
|
||||
AlsoID string
|
||||
} `json:"user"`
|
||||
}
|
||||
package test
|
||||
|
||||
// Code generated by github.com/Khan/genql, DO NOT EDIT.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Khan/genql/graphql"
|
||||
)
|
||||
|
||||
type QueryWithDoubleAliasResponse struct {
|
||||
User *User `json:"user"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
ID string
|
||||
AlsoID string
|
||||
}
|
||||
|
||||
func QueryWithDoubleAlias(client *graphql.Client) (*QueryWithDoubleAliasResponse, error) {
|
||||
var retval QueryWithDoubleAliasResponse
|
||||
err := client.MakeRequest(context.Background(), `
|
||||
query QueryWithDoubleAlias {
|
||||
user {
|
||||
ID: id
|
||||
AlsoID: id
|
||||
}
|
||||
}
|
||||
`, &retval, nil)
|
||||
return &retval, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user