libgraphql

package
v0.0.0-...-ee1e9a0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 4

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

type Definitions struct {
	Name       string
	Repository string
	// contains filtered or unexported fields
}

Definitions contains all the graphql definitions in the service.

func (*Definitions) Gen

func (defs *Definitions) Gen()

Gen will generate the graphql files.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL