github.com/nathanstitt/genqlient@v0.3.1-0.20211028004951-a2bda3c41ab8/generate/testdata/snapshots/TestGenerate-ListInput.graphql-ListInput.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 "github.com/Khan/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 __input := __ListInputQueryInput{ 49 Names: names, 50 } 51 var err error 52 53 var retval ListInputQueryResponse 54 err = client.MakeRequest( 55 nil, 56 "ListInputQuery", 57 ` 58 query ListInputQuery ($names: [String]) { 59 user(query: {names:$names}) { 60 id 61 } 62 } 63 `, 64 &retval, 65 &__input, 66 ) 67 return &retval, err 68 } 69