move everything into snapshot-based testing; update it a bit
This commit is contained in:
+33
@@ -0,0 +1,33 @@
|
||||
package test
|
||||
|
||||
// Code generated by github.com/Khan/genql, DO NOT EDIT.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Khan/genql/graphql"
|
||||
)
|
||||
|
||||
type SimpleInputQueryResponse struct {
|
||||
User *User `json:"user"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
func SimpleInputQuery(client *graphql.Client, name string) (*SimpleInputQueryResponse, error) {
|
||||
variables := map[string]interface{}{
|
||||
"name": name,
|
||||
}
|
||||
|
||||
var retval SimpleInputQueryResponse
|
||||
err := client.MakeRequest(context.Background(), `
|
||||
query SimpleInputQuery ($name: String!) {
|
||||
user(query: {name:$name}) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`, &retval, variables)
|
||||
return &retval, err
|
||||
}
|
||||
Reference in New Issue
Block a user