github.com/codykaup/genqlient@v0.6.2/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.graphql.go (about)

     1  // Code generated by github.com/codykaup/genqlient, DO NOT EDIT.
     2  
     3  package test
     4  
     5  import (
     6  	"github.com/codykaup/genqlient/graphql"
     7  	"github.com/codykaup/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  // The query or mutation executed by ListInputQuery.
    45  const ListInputQuery_Operation = `
    46  query ListInputQuery ($names: [String]) {
    47  	user(query: {names:$names}) {
    48  		id
    49  	}
    50  }
    51  `
    52  
    53  func ListInputQuery(
    54  	client_ graphql.Client,
    55  	names []string,
    56  ) (*ListInputQueryResponse, error) {
    57  	req_ := &graphql.Request{
    58  		OpName: "ListInputQuery",
    59  		Query:  ListInputQuery_Operation,
    60  		Variables: &__ListInputQueryInput{
    61  			Names: names,
    62  		},
    63  	}
    64  	var err_ error
    65  
    66  	var data_ ListInputQueryResponse
    67  	resp_ := &graphql.Response{Data: &data_}
    68  
    69  	err_ = client_.MakeRequest(
    70  		nil,
    71  		req_,
    72  		resp_,
    73  	)
    74  
    75  	return &data_, err_
    76  }
    77