models

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Order struct {
		Auth       func(childComplexity int) int
		AuthHeader func(childComplexity int) int
		Env        func(childComplexity int) int
		Name       func(childComplexity int) int
		Path       func(childComplexity int) int
		Runtime    func(childComplexity int) int
	}

	Query struct {
		Order      func(childComplexity int, name string) int
		Sandwiches func(childComplexity int, runtime Runtime, limit *int) int
		Shops      func(childComplexity int, runtime Runtime, limit *int) int
	}

	Sandwich struct {
		Host     func(childComplexity int) int
		Name     func(childComplexity int) int
		Port     func(childComplexity int) int
		Runtimes func(childComplexity int, id *Runtime) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type Order

type Order struct {
	Name       string    `json:"name"`
	Runtime    *Runtime  `json:"runtime"`
	Path       *string   `json:"path"`
	Env        []*string `json:"env"`
	Auth       *string   `json:"auth"`
	AuthHeader *string   `json:"auth_header"`
}

type QueryResolver

type QueryResolver interface {
	Order(ctx context.Context, name string) (*Order, error)
	Shops(ctx context.Context, runtime Runtime, limit *int) ([]*Sandwich, error)
	Sandwiches(ctx context.Context, runtime Runtime, limit *int) ([]*Sandwich, error)
}

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

type Runtime

type Runtime string
const (
	RuntimeNode14  Runtime = "node14"
	RuntimeNode15  Runtime = "node15"
	RuntimeNode16  Runtime = "node16"
	RuntimeGo1_15  Runtime = "go1_15"
	RuntimeGo1_16  Runtime = "go1_16"
	RuntimeGo1_17  Runtime = "go1_17"
	RuntimePython2 Runtime = "python2"
	RuntimePython3 Runtime = "python3"
	RuntimeBinary  Runtime = "binary"
)

func (Runtime) IsValid

func (e Runtime) IsValid() bool

func (Runtime) MarshalGQL

func (e Runtime) MarshalGQL(w io.Writer)

func (Runtime) String

func (e Runtime) String() string

func (*Runtime) UnmarshalGQL

func (e *Runtime) UnmarshalGQL(v interface{}) error

type Sandwich

type Sandwich struct {
	Name     string     `json:"name"`
	Host     string     `json:"host"`
	Runtimes []*Runtime `json:"runtimes"`
	Port     *int       `json:"port"`
}

Jump to

Keyboard shortcuts

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