Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownType = errors.New("unknown type") ErrTypeNotFound = errors.New("type not found") )
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type BookResolver ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Amazon struct { Referrer func(childComplexity int) int } Book struct { Details func(childComplexity int) int Isbn func(childComplexity int) int Name func(childComplexity int, delimeter *string) int Price func(childComplexity int) int Sku func(childComplexity int) int Title func(childComplexity int) int Upc func(childComplexity int) int Year func(childComplexity int) int } Car struct { Description func(childComplexity int) int ID func(childComplexity int) int Price func(childComplexity int) int } Entity struct { FindBookByIsbn func(childComplexity int, isbn string) int FindCarByID func(childComplexity int, id string) int FindFurnitureBySku func(childComplexity int, sku string) int FindFurnitureByUpc func(childComplexity int, upc string) int FindUserByID func(childComplexity int, id string) int FindVanByID func(childComplexity int, id string) int } Error struct { Code func(childComplexity int) int Message func(childComplexity int) int } Furniture struct { Brand func(childComplexity int) int Details func(childComplexity int) int Metadata func(childComplexity int) int Name func(childComplexity int) int Price func(childComplexity int) int Sku func(childComplexity int) int Upc func(childComplexity int) int } Ikea struct { Asile func(childComplexity int) int } KeyValue struct { Key func(childComplexity int) int Value func(childComplexity int) int } ProductDetailsBook struct { Country func(childComplexity int) int Pages func(childComplexity int) int } ProductDetailsFurniture struct { Color func(childComplexity int) int Country func(childComplexity int) int } Query struct { Product func(childComplexity int, upc string) int TopCars func(childComplexity int, first *int) int TopProducts func(childComplexity int, first *int) int Vehicle func(childComplexity int, id string) int // contains filtered or unexported fields } User struct { ID func(childComplexity int) int Thing func(childComplexity int) int Vehicle func(childComplexity int) int } Van struct { Description func(childComplexity int) int ID func(childComplexity int) int Price func(childComplexity int) int } // contains filtered or unexported fields }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { CacheControl func(ctx context.Context, obj interface{}, next graphql.Resolver, maxAge *int, scope *model.CacheControlScope, inheritMaxAge *bool) (res interface{}, err error) Stream func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) Transform func(ctx context.Context, obj interface{}, next graphql.Resolver, from string) (res interface{}, err error) }
type EntityResolver ¶
type EntityResolver interface { FindBookByIsbn(ctx context.Context, isbn string) (*model.Book, error) FindCarByID(ctx context.Context, id string) (*model.Car, error) FindFurnitureByUpc(ctx context.Context, upc string) (*model.Furniture, error) FindFurnitureBySku(ctx context.Context, sku string) (*model.Furniture, error) FindUserByID(ctx context.Context, id string) (*model.User, error) FindVanByID(ctx context.Context, id string) (*model.Van, error) }
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface { Book() BookResolver Entity() EntityResolver Query() QueryResolver User() UserResolver }
Click to show internal directories.
Click to hide internal directories.