move everything into snapshot-based testing; update it a bit
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
package test
|
||||
|
||||
// Code generated by github.com/Khan/genql, DO NOT EDIT.
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Khan/genql/graphql"
|
||||
)
|
||||
|
||||
type InputObjectQueryResponse struct {
|
||||
User *User `json:"user"`
|
||||
}
|
||||
|
||||
type Role string
|
||||
|
||||
const (
|
||||
StudentRole Role = "STUDENT"
|
||||
TeacherRole Role = "TEACHER"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
type UserQueryInput struct {
|
||||
Email *string `json:"email"`
|
||||
Name *string `json:"name"`
|
||||
Id *string `json:"id"`
|
||||
Role *Role `json:"role"`
|
||||
Names []*string `json:"names"`
|
||||
}
|
||||
|
||||
func InputObjectQuery(client *graphql.Client, query *UserQueryInput) (*InputObjectQueryResponse, error) {
|
||||
variables := map[string]interface{}{
|
||||
"query": query,
|
||||
}
|
||||
|
||||
var retval InputObjectQueryResponse
|
||||
err := client.MakeRequest(context.Background(), `
|
||||
query InputObjectQuery ($query: UserQueryInput) {
|
||||
user(query: $query) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`, &retval, variables)
|
||||
return &retval, err
|
||||
}
|
||||
Reference in New Issue
Block a user