graphql

package
v0.0.0-...-b17db40 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func UnmarshalAudioWrite

func UnmarshalAudioWrite(v interface{}) (types.AudioWrite, error)

func UnmarshalBookWrite

func UnmarshalBookWrite(v interface{}) (types.BookWrite, error)

func UnmarshalProductFilter

func UnmarshalProductFilter(v interface{}) (types.ProductFilter, error)

func UnmarshalVideoWrite

func UnmarshalVideoWrite(v interface{}) (types.VideoWrite, error)

Types

type ComplexityRoot

type ComplexityRoot struct {
	Audio struct {
		Id          func(childComplexity int) int
		Name        func(childComplexity int) int
		Description func(childComplexity int) int
		Value       func(childComplexity int) int
		Singer      func(childComplexity int) int
		Compositor  func(childComplexity int) int
		Duration    func(childComplexity int) int
	}

	Book struct {
		Id          func(childComplexity int) int
		Name        func(childComplexity int) int
		Description func(childComplexity int) int
		Value       func(childComplexity int) int
		Isbn        func(childComplexity int) int
		Author      func(childComplexity int) int
		Flavor      func(childComplexity int) int
	}

	Mutation struct {
		SetBook  func(childComplexity int, book types.BookWrite) int
		SetAudio func(childComplexity int, audio types.AudioWrite) int
		SetVideo func(childComplexity int, video types.VideoWrite) int
	}

	Query struct {
		Book      func(childComplexity int, id string) int
		Audio     func(childComplexity int, id string) int
		Video     func(childComplexity int, id string) int
		ProductBy func(childComplexity int, filter *types.ProductFilter) int
		Search    func(childComplexity int, filter *types.ProductFilter) int
	}

	Video struct {
		Id          func(childComplexity int) int
		Name        func(childComplexity int) int
		Description func(childComplexity int) int
		Value       func(childComplexity int) int
		Director    func(childComplexity int) int
		Writer      func(childComplexity int) int
		Actors      func(childComplexity int) int
		Duration    func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	SetBook(ctx context.Context, book types.BookWrite) (*types.Book, error)
	SetAudio(ctx context.Context, audio types.AudioWrite) (*types.Audio, error)
	SetVideo(ctx context.Context, video types.VideoWrite) (*types.Video, error)
}

type QueryResolver

type QueryResolver interface {
	Book(ctx context.Context, id string) (*types.Book, error)
	Audio(ctx context.Context, id string) (*types.Audio, error)
	Video(ctx context.Context, id string) (*types.Video, error)
	ProductBy(ctx context.Context, filter *types.ProductFilter) (types.Product, error)
	Search(ctx context.Context, filter *types.ProductFilter) (types.SearchResult, error)
}

type Request

type Request struct {
	Query         string                 `json:"query"`
	OperationName string                 `json:"operationName"`
	Variables     map[string]interface{} `json:"variables"`
}

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

type Response

type Response struct {
	*graphql.Response
}

func Execute

func Execute(tree yggdrasil.Tree, schema Schema, request Request) *Response

type Schema

type Schema struct {
	graphql.ExecutableSchema
}

func NewSchema

func NewSchema(resolverRoot ResolverRoot) Schema

Jump to

Keyboard shortcuts

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