Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenSchema ¶
func GenSchema(data []*SchemaData) string
GenSchema will generate the GraphqlQL schema from a list of SchemaData
Types ¶
type Definition ¶
type Definition struct {
Grpc *libgrpc.Definition
CustomFuncs []*liborm.CustomFunc
DisableSelect bool
DisableCreate bool
DisableUpdate bool
DisableDelete bool
}
Definition is used to declare the information of a model, so it can generate its code.
type Definitions ¶
Definitions contains all the graphql definitions in the service.
func (*Definitions) GetByID ¶
func (ds *Definitions) GetByID(id string) *Definition
GetByID return the specified definition by its ID.
func (*Definitions) GetTitle ¶
func (ds *Definitions) GetTitle() string
GetTitle is used to return the name of the definition with InitCap
func (*Definitions) Register ¶
func (ds *Definitions) Register(d *Definition)
Register is used to register a new definition into the service.
func (*Definitions) Slice ¶
func (ds *Definitions) Slice() []*Definition
Slice return the definitions as a slice.
type SchemaData ¶
type SchemaData struct {
Name string
Title string
Definitions *Definitions
Data []struct {
Def *Definition
Model *libdata.ModelDefinition
CustomFuncs []*liborm.CustomFunc
}
}
SchemaData is the main struct to use to declare the GraphQL Schema
Click to show internal directories.
Click to hide internal directories.