Files
genqlient/generate/testdata/snapshots/TestGenerate-DateTime.graphql-DateTime.graphql.go
T
Jan-Hendrik BollandGitHub b2422452a1 Add GraphQL Extensions (#184)
This enables accessing the Extensions field, as defined in the response
format: https://spec.graphql.org/October2021/#sec-Response-Format

Extensions can be enabled using configuration option use_extensions.
This will change the return parameters of the generated client
functions. Making it a breaking change if enabled.

Since extensions are untyped as defined in the spec, the Client will
return an interface of type map[string]interface{}.
2022-03-30 13:48:01 -07:00

62 lines
1.4 KiB
Go

// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
package test
import (
"time"
"github.com/Khan/genqlient/graphql"
)
// __convertTimezoneInput is used internally by genqlient
type __convertTimezoneInput struct {
Dt time.Time `json:"dt"`
Tz string `json:"tz"`
}
// GetDt returns __convertTimezoneInput.Dt, and is useful for accessing the field via an interface.
func (v *__convertTimezoneInput) GetDt() time.Time { return v.Dt }
// GetTz returns __convertTimezoneInput.Tz, and is useful for accessing the field via an interface.
func (v *__convertTimezoneInput) GetTz() string { return v.Tz }
// convertTimezoneResponse is returned by convertTimezone on success.
type convertTimezoneResponse struct {
Convert time.Time `json:"convert"`
}
// GetConvert returns convertTimezoneResponse.Convert, and is useful for accessing the field via an interface.
func (v *convertTimezoneResponse) GetConvert() time.Time { return v.Convert }
func convertTimezone(
client graphql.Client,
dt time.Time,
tz string,
) (*convertTimezoneResponse, error) {
req := &graphql.Request{
OpName: "convertTimezone",
Query: `
query convertTimezone ($dt: DateTime!, $tz: String) {
convert(dt: $dt, tz: $tz)
}
`,
Variables: &__convertTimezoneInput{
Dt: dt,
Tz: tz,
},
}
var err error
var data convertTimezoneResponse
resp := &graphql.Response{Data: &data}
err = client.MakeRequest(
nil,
req,
resp,
)
return &data, err
}