add support for custom scalars -- mainly adding proper import machinery

This commit is contained in:
Ben Kraft
2021-04-08 13:07:31 -07:00
parent e68787ad35
commit b4e8316c6a
31 changed files with 283 additions and 89 deletions
+38
View File
@@ -0,0 +1,38 @@
package test
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
import (
"time"
"github.com/Khan/genqlient/graphql"
)
type convertTimezoneResponse struct {
Convert time.Time `json:"convert"`
}
func convertTimezone(
client graphql.Client,
dt time.Time,
tz string,
) (*convertTimezoneResponse, error) {
variables := map[string]interface{}{
"dt": dt,
"tz": tz,
}
var retval convertTimezoneResponse
err := client.MakeRequest(
nil,
"convertTimezone",
`
query convertTimezone ($dt: DateTime!, $tz: String) {
convert(dt: $dt, tz: $tz)
}
`,
&retval,
variables,
)
return &retval, err
}