github.com/codykaup/genqlient@v0.6.2/generate/testdata/snapshots/TestGenerateWithConfig-NoContext-testdata-queries-generated.go (about)

     1  // Code generated by github.com/codykaup/genqlient, DO NOT EDIT.
     2  
     3  package queries
     4  
     5  import (
     6  	"github.com/codykaup/genqlient/graphql"
     7  )
     8  
     9  // SimpleQueryResponse is returned by SimpleQuery on success.
    10  type SimpleQueryResponse struct {
    11  	// user looks up a user by some stuff.
    12  	//
    13  	// See UserQueryInput for what stuff is supported.
    14  	// If query is null, returns the current user.
    15  	User SimpleQueryUser `json:"user"`
    16  }
    17  
    18  // GetUser returns SimpleQueryResponse.User, and is useful for accessing the field via an interface.
    19  func (v *SimpleQueryResponse) GetUser() SimpleQueryUser { return v.User }
    20  
    21  // SimpleQueryUser includes the requested fields of the GraphQL type User.
    22  // The GraphQL type's documentation follows.
    23  //
    24  // A User is a user!
    25  type SimpleQueryUser struct {
    26  	// id is the user's ID.
    27  	//
    28  	// It is stable, unique, and opaque, like all good IDs.
    29  	Id string `json:"id"`
    30  }
    31  
    32  // GetId returns SimpleQueryUser.Id, and is useful for accessing the field via an interface.
    33  func (v *SimpleQueryUser) GetId() string { return v.Id }
    34  
    35  // The query or mutation executed by SimpleQuery.
    36  const SimpleQuery_Operation = `
    37  query SimpleQuery {
    38  	user {
    39  		id
    40  	}
    41  }
    42  `
    43  
    44  func SimpleQuery(
    45  	client_ graphql.Client,
    46  ) (*SimpleQueryResponse, error) {
    47  	req_ := &graphql.Request{
    48  		OpName: "SimpleQuery",
    49  		Query:  SimpleQuery_Operation,
    50  	}
    51  	var err_ error
    52  
    53  	var data_ SimpleQueryResponse
    54  	resp_ := &graphql.Response{Data: &data_}
    55  
    56  	err_ = client_.MakeRequest(
    57  		nil,
    58  		req_,
    59  		resp_,
    60  	)
    61  
    62  	return &data_, err_
    63  }
    64