Files
genqlient/generate/testdata/snapshots/TestGenerate-QueryWithAlias.graphql-QueryWithAlias.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

66 lines
1.7 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"
)
// QueryWithAliasResponse is returned by QueryWithAlias on success.
type QueryWithAliasResponse 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 QueryWithAliasUser `json:"User"`
}
// GetUser returns QueryWithAliasResponse.User, and is useful for accessing the field via an interface.
func (v *QueryWithAliasResponse) GetUser() QueryWithAliasUser { return v.User }
// QueryWithAliasUser includes the requested fields of the GraphQL type User.
// The GraphQL type's documentation follows.
//
// A User is a user!
type QueryWithAliasUser struct {
// id is the user's ID.
//
// It is stable, unique, and opaque, like all good IDs.
ID testutil.ID `json:"ID"`
// id is the user's ID.
//
// It is stable, unique, and opaque, like all good IDs.
OtherID testutil.ID `json:"otherID"`
}
// GetID returns QueryWithAliasUser.ID, and is useful for accessing the field via an interface.
func (v *QueryWithAliasUser) GetID() testutil.ID { return v.ID }
// GetOtherID returns QueryWithAliasUser.OtherID, and is useful for accessing the field via an interface.
func (v *QueryWithAliasUser) GetOtherID() testutil.ID { return v.OtherID }
func QueryWithAlias(
client graphql.Client,
) (*QueryWithAliasResponse, error) {
var err error
var retval QueryWithAliasResponse
err = client.MakeRequest(
nil,
"QueryWithAlias",
`
query QueryWithAlias {
User: user {
ID: id
otherID: id
}
}
`,
&retval,
nil,
)
return &retval, err
}