add support for custom scalars -- mainly adding proper import machinery
This commit is contained in:
@@ -2,16 +2,7 @@ package {{.Config.Package}}
|
||||
|
||||
// Code generated by github.com/Khan/genqlient, DO NOT EDIT.
|
||||
|
||||
import (
|
||||
{{if .Config.ContextType -}}
|
||||
"{{.Config.ContextPackage}}"
|
||||
{{end}}
|
||||
{{- if .ImportJSON -}}
|
||||
"encoding/json"
|
||||
{{end}}
|
||||
|
||||
"github.com/Khan/genqlient/graphql"
|
||||
)
|
||||
{{.Imports}}
|
||||
|
||||
{{/* TODO: type-assert that your ctx type implements context.Context */}}
|
||||
|
||||
@@ -21,10 +12,10 @@ import (
|
||||
{{.Doc}}
|
||||
func {{.Name}}(
|
||||
{{if $.Config.ContextType -}}
|
||||
ctx {{$.Config.ContextTypeReference}},
|
||||
ctx {{ref $.Config.ContextType}},
|
||||
{{end}}
|
||||
{{- if not $.Config.ClientGetter -}}
|
||||
client graphql.Client,
|
||||
client {{ref "github.com/Khan/genqlient/graphql.Client"}},
|
||||
{{end}}
|
||||
{{- range .Args -}}
|
||||
{{.GoName}} {{.GoType}},
|
||||
|
||||
Reference in New Issue
Block a user