Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type Article
- type Cart
- type CartArticle
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EntityRepresentation
- type EntityResolver
- type EntityWithIndex
- type Mutation
- type MutationResolver
- type Order
- type Query
- type QueryResolver
- type ResolverRoot
- type User
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 Cart ¶
type CartArticle ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Article struct { ID func(childComplexity int) int } Cart struct { Articles func(childComplexity int) int Enabled func(childComplexity int) int ID func(childComplexity int) int Order func(childComplexity int) int OrderID func(childComplexity int) int User func(childComplexity int) int UserID func(childComplexity int) int } CartArticle struct { Article func(childComplexity int) int ArticleID func(childComplexity int) int Quantity func(childComplexity int) int Valid func(childComplexity int) int Validated func(childComplexity int) int } Entity struct { FindCartByID func(childComplexity int, id string) int } Mutation struct { AddArticle func(childComplexity int, articleID string, quantity int) int Checkout func(childComplexity int) int DecrementArticle func(childComplexity int, articleID string) int IncrementArticle func(childComplexity int, articleID string) int RemoveArticle func(childComplexity int, articleID string) int ValidateCart func(childComplexity int) int } Order struct { ID func(childComplexity int) int } Query struct { CurrentCart func(childComplexity int) int // contains filtered or unexported fields } User struct { ID func(childComplexity int) int } // contains filtered or unexported fields }
type Config ¶
type Config struct { Schema *ast.Schema Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type EntityRepresentation ¶
EntityRepresentation is the JSON representation of an entity sent by the Router used as the inputs for us to resolve.
We make it a map because we know the top level JSON is always an object.
type EntityResolver ¶
type EntityWithIndex ¶
type EntityWithIndex struct {
// contains filtered or unexported fields
}
type MutationResolver ¶
type MutationResolver interface { ValidateCart(ctx context.Context) (bool, error) DecrementArticle(ctx context.Context, articleID string) (bool, error) IncrementArticle(ctx context.Context, articleID string) (bool, error) RemoveArticle(ctx context.Context, articleID string) (bool, error) AddArticle(ctx context.Context, articleID string, quantity int) (bool, error) Checkout(ctx context.Context) (bool, error) }
type QueryResolver ¶
type ResolverRoot ¶
type ResolverRoot interface { Entity() EntityResolver Mutation() MutationResolver Query() QueryResolver }
Click to show internal directories.
Click to hide internal directories.