generated

package
v0.0.0-...-2952f12 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 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 {
	Reviews(ctx context.Context, obj *model.Book) ([]*model.Review, error)

	RelatedReviews(ctx context.Context, obj *model.Book) ([]*model.Review, error)
}

type CarResolver

type CarResolver interface {
	RetailPrice(ctx context.Context, obj *model.Car) (*string, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Book struct {
		Isbn           func(childComplexity int) int
		RelatedReviews func(childComplexity int) int
		Reviews        func(childComplexity int) int
		SimilarBooks   func(childComplexity int) int
	}

	Car struct {
		ID          func(childComplexity int) int
		Price       func(childComplexity int) int
		RetailPrice func(childComplexity int) int
	}

	Entity struct {
		FindBookByIsbn     func(childComplexity int, isbn string) int
		FindCarByID        func(childComplexity int, id string) int
		FindFurnitureByUpc func(childComplexity int, upc string) int
		FindReviewByID     func(childComplexity int, id 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 {
		Reviews func(childComplexity int) int
		Upc     func(childComplexity int) int
	}

	KeyValue struct {
		Key   func(childComplexity int) int
		Value func(childComplexity int) int
	}

	Mutation struct {
		DeleteReview  func(childComplexity int, id string) int
		ReviewProduct func(childComplexity int, input model.ReviewProduct) int
		UpdateReview  func(childComplexity int, review model.UpdateReviewInput) int
	}

	Query struct {
		TopReviews func(childComplexity int, first *int) int
		// contains filtered or unexported fields
	}

	Review struct {
		Author   func(childComplexity int) int
		Body     func(childComplexity int, format *bool) int
		ID       func(childComplexity int) int
		Metadata func(childComplexity int) int
		Product  func(childComplexity int) int
	}

	User struct {
		GoodAddress     func(childComplexity int) int
		ID              func(childComplexity int) int
		Metadata        func(childComplexity int) int
		NumberOfReviews func(childComplexity int) int
		Reviews         func(childComplexity int) int
		Username        func(childComplexity int) int
	}

	UserMetadata struct {
		Address func(childComplexity int) int
	}

	Van struct {
		ID          func(childComplexity int) int
		Price       func(childComplexity int) int
		RetailPrice 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 {
	Stream    func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error)
	Tag       func(ctx context.Context, obj interface{}, next graphql.Resolver, name string) (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)
	FindReviewByID(ctx context.Context, id string) (*model.Review, error)
	FindUserByID(ctx context.Context, id string) (*model.User, error)
	FindVanByID(ctx context.Context, id string) (*model.Van, error)
}

type FurnitureResolver

type FurnitureResolver interface {
	Reviews(ctx context.Context, obj *model.Furniture) ([]*model.Review, error)
}

type MutationResolver

type MutationResolver interface {
	ReviewProduct(ctx context.Context, input model.ReviewProduct) (model.Product, error)
	UpdateReview(ctx context.Context, review model.UpdateReviewInput) (*model.Review, error)
	DeleteReview(ctx context.Context, id string) (*bool, error)
}

type QueryResolver

type QueryResolver interface {
	TopReviews(ctx context.Context, first *int) ([]*model.Review, error)
}

type ResolverRoot

type ResolverRoot interface {
	Book() BookResolver
	Car() CarResolver
	Entity() EntityResolver
	Furniture() FurnitureResolver
	Mutation() MutationResolver
	Query() QueryResolver
	Review() ReviewResolver
	User() UserResolver
	Van() VanResolver
}

type ReviewResolver

type ReviewResolver interface {
	Author(ctx context.Context, obj *model.Review) (*model.User, error)
}

type UserResolver

type UserResolver interface {
	Username(ctx context.Context, obj *model.User) (*string, error)
	Reviews(ctx context.Context, obj *model.User) ([]*model.Review, error)
	NumberOfReviews(ctx context.Context, obj *model.User) (int, error)

	GoodAddress(ctx context.Context, obj *model.User) (*bool, error)
}

type VanResolver

type VanResolver interface {
	RetailPrice(ctx context.Context, obj *model.Van) (*string, error)
}

Jump to

Keyboard shortcuts

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