github.com/nathanstitt/genqlient@v0.3.1-0.20211028004951-a2bda3c41ab8/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go (about) 1 package test 2 3 // Code generated by github.com/Khan/genqlient, DO NOT EDIT. 4 5 import ( 6 "time" 7 8 "github.com/Khan/genqlient/graphql" 9 ) 10 11 // __convertTimezoneInput is used internally by genqlient 12 type __convertTimezoneInput struct { 13 Dt time.Time `json:"dt"` 14 Tz string `json:"tz"` 15 } 16 17 // GetDt returns __convertTimezoneInput.Dt, and is useful for accessing the field via an interface. 18 func (v *__convertTimezoneInput) GetDt() time.Time { return v.Dt } 19 20 // GetTz returns __convertTimezoneInput.Tz, and is useful for accessing the field via an interface. 21 func (v *__convertTimezoneInput) GetTz() string { return v.Tz } 22 23 // convertTimezoneResponse is returned by convertTimezone on success. 24 type convertTimezoneResponse struct { 25 Convert time.Time `json:"convert"` 26 } 27 28 // GetConvert returns convertTimezoneResponse.Convert, and is useful for accessing the field via an interface. 29 func (v *convertTimezoneResponse) GetConvert() time.Time { return v.Convert } 30 31 func convertTimezone( 32 client graphql.Client, 33 dt time.Time, 34 tz string, 35 ) (*convertTimezoneResponse, error) { 36 __input := __convertTimezoneInput{ 37 Dt: dt, 38 Tz: tz, 39 } 40 var err error 41 42 var retval convertTimezoneResponse 43 err = client.MakeRequest( 44 nil, 45 "convertTimezone", 46 ` 47 query convertTimezone ($dt: DateTime!, $tz: String) { 48 convert(dt: $dt, tz: $tz) 49 } 50 `, 51 &retval, 52 &__input, 53 ) 54 return &retval, err 55 } 56