gengraphql

package
v0.0.0-...-6dd30b8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(service e2e.Service, hooks *twirp.ServerHooks) *handler.Server

Handler returns a handler to the GraphQL API. Server Hooks are optional but if present, they will be injected as GraphQL middleware.

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func Playground

func Playground(title, endpoint string) http.Handler

Playground is a proxy to github.com/99designs/gqlgen/handler.Playground All you need to do is provide a title and the URL Path to the GraphQL handler

Types

type BreadRespResolver

type BreadRespResolver interface {
	Answer(ctx context.Context, obj *e2e.BreadResp) (unionMask, error)
}

type ChangeMeRespResolver

type ChangeMeRespResolver interface {
	Previous(ctx context.Context, obj *e2e.ChangeMeResp) (Previous, error)
	Answer(ctx context.Context, obj *e2e.ChangeMeResp) (unionMask, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	BreadResp struct {
		Answer func(childComplexity int) int
	}

	BreadRespAnswerName struct {
		Name func(childComplexity int) int
	}

	BreadRespAnswerToasted struct {
		Toasted func(childComplexity int) int
	}

	ChangeMeResp struct {
		Answer   func(childComplexity int) int
		Name     func(childComplexity int) int
		Previous func(childComplexity int) int
	}

	ChangeMeRespAnswerChanged struct {
		Changed func(childComplexity int) int
	}

	ChangeMeRespAnswerNewName struct {
		NewName func(childComplexity int) int
	}

	HelloResp struct {
		Text func(childComplexity int) int
	}

	Mutation struct {
		ChangeMe func(childComplexity int, req *e2e.ChangeMeReq) int
	}

	PaintersResp struct {
		AllPainters func(childComplexity int) int
		BestPainter func(childComplexity int) int
	}

	PaintersPainter struct {
		Name func(childComplexity int) int
	}

	Query struct {
		Bread       func(childComplexity int, req *e2e.BreadReq) int
		GetPainters func(childComplexity int) int
		Hello       func(childComplexity int, req *e2e.HelloReq) int
		TrafficJam  func(childComplexity int, req *e2e.TrafficJamReq) int
		Translate   func(childComplexity int, req *e2e.TranslateReq) int
	}

	TrafficJamResp struct {
		Next func(childComplexity int) int
	}

	TranslateResp struct {
		Translations 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 {
	ChangeMe(ctx context.Context, req *e2e.ChangeMeReq) (*e2e.ChangeMeResp, error)
}

type Previous

type Previous map[string]*e2e.ChangeMeResp

func (Previous) MarshalGQL

func (scalar Previous) MarshalGQL(w io.Writer)

func (*Previous) UnmarshalGQL

func (scalar *Previous) UnmarshalGQL(v interface{}) error

type QueryResolver

type QueryResolver interface {
	Hello(ctx context.Context, req *e2e.HelloReq) (*e2e.HelloResp, error)
	TrafficJam(ctx context.Context, req *e2e.TrafficJamReq) (*e2e.TrafficJamResp, error)
	GetPainters(ctx context.Context) (*e2e.PaintersResp, error)
	Translate(ctx context.Context, req *e2e.TranslateReq) (*e2e.TranslateResp, error)
	Bread(ctx context.Context, req *e2e.BreadReq) (*e2e.BreadResp, error)
}

type Resolver

type Resolver struct {
	e2e.Service
}

func (*Resolver) BreadResp

func (r *Resolver) BreadResp() BreadRespResolver

func (*Resolver) ChangeMeResp

func (r *Resolver) ChangeMeResp() ChangeMeRespResolver

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

func (*Resolver) TranslateResp

func (r *Resolver) TranslateResp() TranslateRespResolver

type ResolverRoot

type ResolverRoot interface {
	BreadResp() BreadRespResolver
	ChangeMeResp() ChangeMeRespResolver
	Mutation() MutationResolver
	Query() QueryResolver
	TranslateResp() TranslateRespResolver
}

type TranslateRespResolver

type TranslateRespResolver interface {
	Translations(ctx context.Context, obj *e2e.TranslateResp) (Translations, error)
}

type Translations

type Translations map[string]*e2e.Word

func (Translations) MarshalGQL

func (scalar Translations) MarshalGQL(w io.Writer)

func (*Translations) UnmarshalGQL

func (scalar *Translations) UnmarshalGQL(v interface{}) error

type Words

type Words map[string]*e2e.Word

func (Words) MarshalGQL

func (scalar Words) MarshalGQL(w io.Writer)

func (*Words) UnmarshalGQL

func (scalar *Words) UnmarshalGQL(v interface{}) error

Jump to

Keyboard shortcuts

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