github.com/opiuman/genqlient@v1.0.0/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go (about)

     1  // Code generated by github.com/opiuman/genqlient, DO NOT EDIT.
     2  
     3  package test
     4  
     5  import (
     6  	"github.com/opiuman/genqlient/graphql"
     7  	"github.com/opiuman/genqlient/internal/testutil"
     8  )
     9  
    10  // ListInputQueryResponse is returned by ListInputQuery on success.
    11  type ListInputQueryResponse struct {
    12  	// user looks up a user by some stuff.
    13  	//
    14  	// See UserQueryInput for what stuff is supported.
    15  	// If query is null, returns the current user.
    16  	User ListInputQueryUser `json:"user"`
    17  }
    18  
    19  // GetUser returns ListInputQueryResponse.User, and is useful for accessing the field via an interface.
    20  func (v *ListInputQueryResponse) GetUser() ListInputQueryUser { return v.User }
    21  
    22  // ListInputQueryUser includes the requested fields of the GraphQL type User.
    23  // The GraphQL type's documentation follows.
    24  //
    25  // A User is a user!
    26  type ListInputQueryUser struct {
    27  	// id is the user's ID.
    28  	//
    29  	// It is stable, unique, and opaque, like all good IDs.
    30  	Id testutil.ID `json:"id"`
    31  }
    32  
    33  // GetId returns ListInputQueryUser.Id, and is useful for accessing the field via an interface.
    34  func (v *ListInputQueryUser) GetId() testutil.ID { return v.Id }
    35  
    36  // __ListInputQueryInput is used internally by genqlient
    37  type __ListInputQueryInput struct {
    38  	Names []string `json:"names"`
    39  }
    40  
    41  // GetNames returns __ListInputQueryInput.Names, and is useful for accessing the field via an interface.
    42  func (v *__ListInputQueryInput) GetNames() []string { return v.Names }
    43  
    44  func ListInputQuery(
    45  	client graphql.Client,
    46  	names []string,
    47  ) (*ListInputQueryResponse, error) {
    48  	req := &graphql.Request{
    49  		OpName: "ListInputQuery",
    50  		Query: `
    51  query ListInputQuery ($names: [String]) {
    52  	user(query: {names:$names}) {
    53  		id
    54  	}
    55  }
    56  `,
    57  		Variables: &__ListInputQueryInput{
    58  			Names: names,
    59  		},
    60  	}
    61  	var err error
    62  
    63  	var data ListInputQueryResponse
    64  	resp := &graphql.Response{Data: &data}
    65  
    66  	err = client.MakeRequest(
    67  		nil,
    68  		req,
    69  		resp,
    70  	)
    71  
    72  	return &data, err
    73  }
    74