48 lines
851 B
Go
48 lines
851 B
Go
package test
|
|
|
|
// Code generated by github.com/Khan/genql, DO NOT EDIT.
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Khan/genql/graphql"
|
|
)
|
|
|
|
type QueryWithInputResponse 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"`
|
|
}
|
|
|
|
func QueryWithInput(client *graphql.Client, query *UserQueryInput) (*QueryWithInputResponse, error) {
|
|
variables := map[string]interface{}{
|
|
"query": query,
|
|
}
|
|
|
|
var retval QueryWithInputResponse
|
|
err := client.MakeRequest(context.Background(), `
|
|
query QueryWithInput ($query: UserQueryInput) {
|
|
user(query: $query) {
|
|
id
|
|
}
|
|
}
|
|
`, &retval, variables)
|
|
return &retval, err
|
|
}
|