github.com/nathanstitt/genqlient@v0.3.1-0.20211028004951-a2bda3c41ab8/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go (about)

     1  package test
     2  
     3  // Code generated by github.com/Khan/genqlient, DO NOT EDIT.
     4  
     5  import (
     6  	"github.com/Khan/genqlient/graphql"
     7  )
     8  
     9  // QueryWithSlicesResponse is returned by QueryWithSlices on success.
    10  type QueryWithSlicesResponse 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 QueryWithSlicesUser `json:"user"`
    16  }
    17  
    18  // GetUser returns QueryWithSlicesResponse.User, and is useful for accessing the field via an interface.
    19  func (v *QueryWithSlicesResponse) GetUser() QueryWithSlicesUser { return v.User }
    20  
    21  // QueryWithSlicesUser 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 QueryWithSlicesUser struct {
    26  	Emails                []string `json:"emails"`
    27  	EmailsOrNull          []string `json:"emailsOrNull"`
    28  	EmailsWithNulls       []string `json:"emailsWithNulls"`
    29  	EmailsWithNullsOrNull []string `json:"emailsWithNullsOrNull"`
    30  }
    31  
    32  // GetEmails returns QueryWithSlicesUser.Emails, and is useful for accessing the field via an interface.
    33  func (v *QueryWithSlicesUser) GetEmails() []string { return v.Emails }
    34  
    35  // GetEmailsOrNull returns QueryWithSlicesUser.EmailsOrNull, and is useful for accessing the field via an interface.
    36  func (v *QueryWithSlicesUser) GetEmailsOrNull() []string { return v.EmailsOrNull }
    37  
    38  // GetEmailsWithNulls returns QueryWithSlicesUser.EmailsWithNulls, and is useful for accessing the field via an interface.
    39  func (v *QueryWithSlicesUser) GetEmailsWithNulls() []string { return v.EmailsWithNulls }
    40  
    41  // GetEmailsWithNullsOrNull returns QueryWithSlicesUser.EmailsWithNullsOrNull, and is useful for accessing the field via an interface.
    42  func (v *QueryWithSlicesUser) GetEmailsWithNullsOrNull() []string { return v.EmailsWithNullsOrNull }
    43  
    44  func QueryWithSlices(
    45  	client graphql.Client,
    46  ) (*QueryWithSlicesResponse, error) {
    47  	var err error
    48  
    49  	var retval QueryWithSlicesResponse
    50  	err = client.MakeRequest(
    51  		nil,
    52  		"QueryWithSlices",
    53  		`
    54  query QueryWithSlices {
    55  	user {
    56  		emails
    57  		emailsOrNull
    58  		emailsWithNulls
    59  		emailsWithNullsOrNull
    60  	}
    61  }
    62  `,
    63  		&retval,
    64  		nil,
    65  	)
    66  	return &retval, err
    67  }
    68