generated

package
v0.0.0-...-83efb8c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 14 Imported by: 0

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 BookResolver interface {
	Upc(ctx context.Context, obj *model.Book) (string, error)
	Sku(ctx context.Context, obj *model.Book) (string, error)
	Name(ctx context.Context, obj *model.Book, delimeter *string) (*string, error)
}

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 QueryResolver interface {
	Product(ctx context.Context, upc string) (model.Product, error)
	Vehicle(ctx context.Context, id string) (model.Vehicle, error)
	TopProducts(ctx context.Context, first *int) ([]model.Product, error)
	TopCars(ctx context.Context, first *int) ([]*model.Car, error)
}

type ResolverRoot

type ResolverRoot interface {
	Book() BookResolver
	Entity() EntityResolver
	Query() QueryResolver
	User() UserResolver
}

type UserResolver

type UserResolver interface {
	Vehicle(ctx context.Context, obj *model.User) (model.Vehicle, error)
	Thing(ctx context.Context, obj *model.User) (model.Thing, error)
}

Jump to

Keyboard shortcuts

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