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