schema

package
v0.0.0-...-ef759c8 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExtensionStore = []Extension{}
View Source
var NodeType = graphql.NewInterface(graphql.InterfaceConfig{
	Name: "Node",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.NewNonNull(graphql.ID),
		},
	},
})

Functions

func AfterSave

func AfterSave[T any](params graphql.ResolveParams) []func(T) error

func GetID

func GetID(input map[string]interface{}) int

func GetInput

func GetInput(input *graphql.InputObject) *graphql.InputObject

func NewWhereInput

func NewWhereInput(name string) *graphql.InputObject

func NewWhereInputForOutput

func NewWhereInputForOutput(name string, output graphql.Output) *graphql.InputObject

Types

type Config

type Config struct {
	Fields map[string]Field
}

type Extension

type Extension struct {
	Inputs  []string
	Fields  []ExtensionField
	Resolve func(graphql.ResolveParams, any) error
}

type ExtensionField

type ExtensionField struct {
	Name  string
	Field *graphql.InputObjectFieldConfig
}

type Field

type Field struct {
	DB          any                     `yaml:"db"`
	Fieldconfig any                     `yaml:"fieldconfig"`
	GraphQL     map[string]GraphQLField `yml:"graphQL"`
}

type GraphQLField

type GraphQLField struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`
}

type Query

type Query interface {
	Where(...func(*sql.Selector))
}

type SchemaTypeFactory

type SchemaTypeFactory struct{}

func (*SchemaTypeFactory) ApplyFilter

func (f *SchemaTypeFactory) ApplyFilter(s *sql.Selector, filter map[string]interface{})

func (*SchemaTypeFactory) CreateFilter

func (f *SchemaTypeFactory) CreateFilter()

type TypeResolver

type TypeResolver struct {
	Type    graphql.Type
	Resolve func(context.Context, int) (interface{}, error)
}

Jump to

Keyboard shortcuts

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