1f442da041
Slightly uglier filenames, but less code and free diffing! Approved in ADR-466 for Khan use. Fixes #23.
57 lines
1.2 KiB
Go
57 lines
1.2 KiB
Go
package test
|
|
|
|
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
|
|
|
|
import (
|
|
"github.com/Khan/genqlient/graphql"
|
|
"github.com/Khan/genqlient/internal/testutil"
|
|
)
|
|
|
|
// SimpleMutationCreateUser includes the requested fields of the GraphQL type User.
|
|
// The GraphQL type's documentation follows.
|
|
//
|
|
// A User is a user!
|
|
type SimpleMutationCreateUser struct {
|
|
// id is the user's ID.
|
|
//
|
|
// It is stable, unique, and opaque, like all good IDs.
|
|
Id testutil.ID `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// SimpleMutationResponse is returned by SimpleMutation on success.
|
|
type SimpleMutationResponse struct {
|
|
CreateUser SimpleMutationCreateUser `json:"createUser"`
|
|
}
|
|
|
|
// SimpleMutation creates a user.
|
|
//
|
|
// It has a long doc-comment, to test that we handle that correctly.
|
|
// What a long comment indeed.
|
|
func SimpleMutation(
|
|
client graphql.Client,
|
|
name string,
|
|
) (*SimpleMutationResponse, error) {
|
|
variables := map[string]interface{}{
|
|
"name": name,
|
|
}
|
|
|
|
var retval SimpleMutationResponse
|
|
err := client.MakeRequest(
|
|
nil,
|
|
"SimpleMutation",
|
|
`
|
|
mutation SimpleMutation ($name: String!) {
|
|
createUser(name: $name) {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
`,
|
|
&retval,
|
|
variables,
|
|
)
|
|
return &retval, err
|
|
}
|
|
|