Files
genqlient/generate/testdata/snapshots/TestGenerate-SimpleInput.graphql-SimpleInput.graphql.go
T
Adam Babik f0c2ac17a9 Move 'Code generated by' disclaimer up (#161)
`Code generated by` disclaimer should be at the top of the file, as it is demonstrated in [this article](https://go.dev/blog/generate) on The Go Blog.

The current placing breaks integration with some code formatters and linters which do no skip files generated by `genqlient`.
2021-12-20 10:04:13 -05:00

70 lines
1.8 KiB
Go

// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
package test
import (
"github.com/Khan/genqlient/graphql"
"github.com/Khan/genqlient/internal/testutil"
)
// SimpleInputQueryResponse is returned by SimpleInputQuery on success.
type SimpleInputQueryResponse struct {
// user looks up a user by some stuff.
//
// See UserQueryInput for what stuff is supported.
// If query is null, returns the current user.
User SimpleInputQueryUser `json:"user"`
}
// GetUser returns SimpleInputQueryResponse.User, and is useful for accessing the field via an interface.
func (v *SimpleInputQueryResponse) GetUser() SimpleInputQueryUser { return v.User }
// SimpleInputQueryUser includes the requested fields of the GraphQL type User.
// The GraphQL type's documentation follows.
//
// A User is a user!
type SimpleInputQueryUser struct {
// id is the user's ID.
//
// It is stable, unique, and opaque, like all good IDs.
Id testutil.ID `json:"id"`
}
// GetId returns SimpleInputQueryUser.Id, and is useful for accessing the field via an interface.
func (v *SimpleInputQueryUser) GetId() testutil.ID { return v.Id }
// __SimpleInputQueryInput is used internally by genqlient
type __SimpleInputQueryInput struct {
Name string `json:"name"`
}
// GetName returns __SimpleInputQueryInput.Name, and is useful for accessing the field via an interface.
func (v *__SimpleInputQueryInput) GetName() string { return v.Name }
func SimpleInputQuery(
client graphql.Client,
name string,
) (*SimpleInputQueryResponse, error) {
__input := __SimpleInputQueryInput{
Name: name,
}
var err error
var retval SimpleInputQueryResponse
err = client.MakeRequest(
nil,
"SimpleInputQuery",
`
query SimpleInputQuery ($name: String!) {
user(query: {name:$name}) {
id
}
}
`,
&retval,
&__input,
)
return &retval, err
}