Documentation ¶
Index ¶
- Variables
- func GenServer() string
- type FieldDef
- type Generator
- func (g *Generator) Error(err error, msgs ...string)
- func (g *Generator) Fail(msgs ...string)
- func (g Generator) GenSchemaResolversFile() []byte
- func (g Generator) GenServerFile() []byte
- func (g *Generator) In()
- func (g *Generator) Out()
- func (g *Generator) P(str ...interface{})
- func (g *Generator) Parse(fileData []byte) error
- func (g *Generator) SetPkgName(name string) *Generator
- type SchemaMap
- type Typ
- type TypeDef
- func (t *TypeDef) GenInterface() string
- func (t *TypeDef) GenInterfaceResStruct(typePkgName string) string
- func (t *TypeDef) GenResStruct(typePkgName string) string
- func (t *TypeDef) GenStruct(typ string) string
- func (t *TypeDef) GenUnionResStruct() string
- func (t *TypeDef) GenUnionResolver(parentName string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var KnownGQLTypes = map[string]bool{ "__Directive": true, "__DirectiveLocation": true, "__EnumValue": true, "__Field": true, "__InputValue": true, "__Schema": true, "__Type": true, "__TypeKind": true, "LIST": true, "String": true, "Float": true, "ID": true, "Int": true, "Boolean": true, "Time": true, }
Functions ¶
Types ¶
type FieldDef ¶
type FieldDef struct { Name string Parent string Description string Type *Typ Args []*FieldDef // contains filtered or unexported fields }
func NewField ¶
func NewField(t *introspection.Field) *FieldDef
func (*FieldDef) GenFuncArgs ¶
FIXME could be refactored and become part of GenResStruct()
func (*FieldDef) GenResolver ¶
Resolvers generates the resolver function for the given FieldDef
type Generator ¶
func New ¶
func New() *Generator
New creates a new generator and allocates the request and response protobufs.
func (Generator) GenSchemaResolversFile ¶
Fill the buffer with the generated output for all the files we're supposed to generate.
func (Generator) GenServerFile ¶
func (*Generator) P ¶
func (g *Generator) P(str ...interface{})
P prints the arguments to the generated output. It handles strings and int32s, plus handling indirections because they may be *string, etc.
func (*Generator) SetPkgName ¶
type SchemaMap ¶
type SchemaMap struct { RootTypes map[string]string ResolverTypes map[string]string ResolverFuncs map[string]string }
func NewSchemaMap ¶
func NewSchemaMap() *SchemaMap
type TypeDef ¶
type TypeDef struct { Name string Description string Fields map[string]*FieldDef GQLType string // contains filtered or unexported fields }
func NewType ¶
func NewType(t *introspection.Type) *TypeDef
func (*TypeDef) GenInterface ¶
FIXME could be refactored and become part of GenStruct()
func (*TypeDef) GenInterfaceResStruct ¶
FIXME could be refactored and become part of GenResStruct()
func (*TypeDef) GenResStruct ¶
func (*TypeDef) GenUnionResStruct ¶
func (*TypeDef) GenUnionResolver ¶
Click to show internal directories.
Click to hide internal directories.