Documentation ¶
Index ¶
Constants ¶
View Source
const ( Header = `// Code generated by go generate; DO NOT EDIT. // This file was generated from GraphQL schema package %s ` StructTPL = `type %s struct { %s }` FieldTPL = " %s %s `json:\"%s\"`" ListFieldTPL = " %s []%s `json:\"%s\"`" EnumTypeDefTPL = "type %s %s" EnumDefConstTPL = "const %s%s %s = \"%s\"" )
Variables ¶
View Source
var GQLTypesToGoTypes = map[string]string{
"Int": "int64",
"Float": "float64",
"String": "string",
"Boolean": "bool",
"ID": "string",
}
Functions ¶
func LoadSchemas ¶ added in v1.1.0
func LoadSchemas(inputSchemas []InputSchema) (*ast.SchemaDocument, error)
Types ¶
type Config ¶ added in v1.1.0
type Config struct { Schemas []string Outputs []OutputItem InPlace bool GoGenConfig *GOGenerate }
type FileOutput ¶
func NewFileOutput ¶
func NewFileOutput(fName string) (*FileOutput, error)
func (*FileOutput) Close ¶
func (o *FileOutput) Close() error
func (*FileOutput) Flush ¶
func (o *FileOutput) Flush() error
func (*FileOutput) Write ¶
func (o *FileOutput) Write(s string) error
func (*FileOutput) Writeln ¶
func (o *FileOutput) Writeln(s string) error
type GOGenerate ¶ added in v1.1.0
func GetGOGenerate ¶ added in v1.1.0
func GetGOGenerate() *GOGenerate
type GoGenerator ¶
type GoGenerator struct {
// contains filtered or unexported fields
}
func NewGoGenerator ¶
func NewGoGenerator(output Outputer, entities []string, packageName string) *GoGenerator
func (*GoGenerator) Generate ¶
func (g *GoGenerator) Generate(doc *ast.SchemaDocument) error
type InputSchema ¶ added in v1.1.0
func ReadSchemas ¶ added in v1.1.0
func ReadSchemas(schemaPaths []string) ([]InputSchema, error)
type OutputItem ¶ added in v1.1.0
type STDOutput ¶
type STDOutput struct {
// contains filtered or unexported fields
}
func NewSTDOutput ¶
func NewSTDOutput() *STDOutput
type YamlConfig ¶ added in v1.1.0
type YamlConfig struct { Schema []string `yaml:"schema"` Generates map[string]YamlGenerateItem `yaml:"generates"` }
type YamlGenerateConfig ¶ added in v1.1.0
type YamlGenerateItem ¶ added in v1.1.0
type YamlGenerateItem struct {
Config YamlGenerateConfig `yaml:"config"`
}
Click to show internal directories.
Click to hide internal directories.