github.com/Desuuuu/genqlient@v0.5.3/generate/testdata/snapshots/TestGenerate-QueryWithSlices.graphql-QueryWithSlices.graphql.go (about) 1 // Code generated by github.com/Desuuuu/genqlient, DO NOT EDIT. 2 3 package test 4 5 import ( 6 "github.com/Desuuuu/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 req := &graphql.Request{ 48 OpName: "QueryWithSlices", 49 Query: ` 50 query QueryWithSlices { 51 user { 52 emails 53 emailsOrNull 54 emailsWithNulls 55 emailsWithNullsOrNull 56 } 57 } 58 `, 59 } 60 var err error 61 62 var data QueryWithSlicesResponse 63 resp := &graphql.Response{Data: &data} 64 65 err = client.MakeRequest( 66 nil, 67 req, 68 resp, 69 ) 70 71 return &data, err 72 } 73