Documentation ¶
Index ¶
- Variables
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type DirectiveRoot
- type EntityResolver
- type FileResolver
- type ImageResolver
- type MutationResolver
- type PackageResolver
- type PlaceResolver
- type PostResolver
- type ProductResolver
- type QueryResolver
- type Resolver
- func (r *Resolver) Entity() EntityResolver
- func (r *Resolver) File() FileResolver
- func (r *Resolver) Image() ImageResolver
- func (r *Resolver) Mutation() MutationResolver
- func (r *Resolver) Package() PackageResolver
- func (r *Resolver) Place() PlaceResolver
- func (r *Resolver) Post() PostResolver
- func (r *Resolver) Product() ProductResolver
- func (r *Resolver) Query() QueryResolver
- func (r *Resolver) Template() TemplateResolver
- func (r *Resolver) User() UserResolver
- type ResolverRoot
- type TemplateResolver
- type UserResolver
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 ComplexityRoot ¶
type ComplexityRoot struct { Entity struct { FindFileByID func(childComplexity int, id string) int FindImageByID func(childComplexity int, id string) int FindPackageByID func(childComplexity int, id string) int FindPlaceByID func(childComplexity int, id string) int FindPostByID func(childComplexity int, id string) int FindProductByID func(childComplexity int, id string) int FindTemplateByID func(childComplexity int, id string) int FindUserByID func(childComplexity int, id string) int } File struct { Created func(childComplexity int) int Description func(childComplexity int) int ID func(childComplexity int) int Locale func(childComplexity int) int Metadata func(childComplexity int) int Name func(childComplexity int) int Provider func(childComplexity int) int Size func(childComplexity int) int Starred func(childComplexity int) int Status func(childComplexity int) int Type func(childComplexity int) int UID func(childComplexity int) int URL func(childComplexity int) int Updated func(childComplexity int) int } Files struct { Count func(childComplexity int) int Data func(childComplexity int) int } Image struct { Caption func(childComplexity int) int ID func(childComplexity int) int Locale func(childComplexity int) int Metadata func(childComplexity int) int Object func(childComplexity int) int Order func(childComplexity int) int Title func(childComplexity int) int Type func(childComplexity int) int URL func(childComplexity int) int } Mutation struct { CreateFile func(childComplexity int, input model.NewFile) int CreatePost func(childComplexity int, input model.NewPost) int DeleteFile func(childComplexity int, id string) int DeleteFiles func(childComplexity int, ids []string) int DeletePost func(childComplexity int, filter map[string]interface{}) int UpdateFile func(childComplexity int, id string, input model.UpdateFile) int UpdatePost func(childComplexity int, id string, input model.UpdatePost) int } Package struct { ID func(childComplexity int) int Images func(childComplexity int) int } Place struct { ID func(childComplexity int) int Images func(childComplexity int) int } Post struct { Body func(childComplexity int) int Commentable func(childComplexity int) int Created func(childComplexity int) int ID func(childComplexity int) int Images func(childComplexity int) int Locale func(childComplexity int) int Metadata func(childComplexity int) int Parent func(childComplexity int) int Slug func(childComplexity int) int Status func(childComplexity int) int Summary func(childComplexity int) int Title func(childComplexity int) int Type func(childComplexity int) int UID func(childComplexity int) int Updated func(childComplexity int) int } Posts struct { Count func(childComplexity int) int Data func(childComplexity int) int } Product struct { ID func(childComplexity int) int Images func(childComplexity int) int } Query struct { File func(childComplexity int, id string) int Files func(childComplexity int, stages map[string]interface{}) int Post func(childComplexity int, id string) int Posts func(childComplexity int, stages map[string]interface{}) int // contains filtered or unexported fields } Template struct { ID func(childComplexity int) int Images func(childComplexity int) int } User struct { Files func(childComplexity int) int ID func(childComplexity int) int Posts 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 { Api func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) Auth func(ctx context.Context, obj interface{}, next graphql.Resolver, roles []string) (res interface{}, err error) ComposeDirective func(ctx context.Context, obj interface{}, next graphql.Resolver, name string) (res interface{}, err error) HasScope func(ctx context.Context, obj interface{}, next graphql.Resolver, scope []string) (res interface{}, err error) InterfaceObject func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) }
type EntityResolver ¶
type EntityResolver interface { FindFileByID(ctx context.Context, id string) (*model.File, error) FindImageByID(ctx context.Context, id string) (*model.Image, error) FindPackageByID(ctx context.Context, id string) (*model.Package, error) FindPlaceByID(ctx context.Context, id string) (*model.Place, error) FindPostByID(ctx context.Context, id string) (*model.Post, error) FindProductByID(ctx context.Context, id string) (*model.Product, error) FindTemplateByID(ctx context.Context, id string) (*model.Template, error) FindUserByID(ctx context.Context, id string) (*model.User, error) }
type FileResolver ¶
type FileResolver interface { ID(ctx context.Context, obj *model.File) (string, error) UID(ctx context.Context, obj *model.File) (string, error) Name(ctx context.Context, obj *model.File) (string, error) Description(ctx context.Context, obj *model.File) (*string, error) Metadata(ctx context.Context, obj *model.File) (map[string]interface{}, error) Created(ctx context.Context, obj *model.File) (string, error) Updated(ctx context.Context, obj *model.File) (string, error) }
type ImageResolver ¶
type ImageResolver interface { ID(ctx context.Context, obj *model.Image) (string, error) Object(ctx context.Context, obj *model.Image) (map[string]interface{}, error) Title(ctx context.Context, obj *model.Image) (*string, error) Caption(ctx context.Context, obj *model.Image) (*string, error) Metadata(ctx context.Context, obj *model.Image) (map[string]interface{}, error) }
type MutationResolver ¶
type MutationResolver interface { CreateFile(ctx context.Context, input model.NewFile) (*model.File, error) UpdateFile(ctx context.Context, id string, input model.UpdateFile) (*model.File, error) DeleteFile(ctx context.Context, id string) (map[string]interface{}, error) DeleteFiles(ctx context.Context, ids []string) (map[string]interface{}, error) CreatePost(ctx context.Context, input model.NewPost) (*model.Post, error) UpdatePost(ctx context.Context, id string, input model.UpdatePost) (*model.Post, error) DeletePost(ctx context.Context, filter map[string]interface{}) (map[string]interface{}, error) }
type PackageResolver ¶
type PlaceResolver ¶
type PostResolver ¶
type PostResolver interface { ID(ctx context.Context, obj *model.Post) (string, error) Title(ctx context.Context, obj *model.Post) (string, error) Summary(ctx context.Context, obj *model.Post) (string, error) Body(ctx context.Context, obj *model.Post) (string, error) Metadata(ctx context.Context, obj *model.Post) (map[string]interface{}, error) UID(ctx context.Context, obj *model.Post) (string, error) Created(ctx context.Context, obj *model.Post) (string, error) Updated(ctx context.Context, obj *model.Post) (string, error) Parent(ctx context.Context, obj *model.Post) (*model.Post, error) Images(ctx context.Context, obj *model.Post) ([]*model.Image, error) }
type ProductResolver ¶
type QueryResolver ¶
type QueryResolver interface { Files(ctx context.Context, stages map[string]interface{}) (*model.Files, error) File(ctx context.Context, id string) (*model.File, error) Post(ctx context.Context, id string) (*model.Post, error) Posts(ctx context.Context, stages map[string]interface{}) (*model.Posts, error) }
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func (*Resolver) Entity ¶
func (r *Resolver) Entity() EntityResolver
Entity returns EntityResolver implementation.
func (*Resolver) File ¶
func (r *Resolver) File() FileResolver
File returns FileResolver implementation.
func (*Resolver) Image ¶
func (r *Resolver) Image() ImageResolver
Image returns ImageResolver implementation.
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Package ¶
func (r *Resolver) Package() PackageResolver
Package returns PackageResolver implementation.
func (*Resolver) Place ¶
func (r *Resolver) Place() PlaceResolver
Place returns PlaceResolver implementation.
func (*Resolver) Post ¶
func (r *Resolver) Post() PostResolver
Post returns PostResolver implementation.
func (*Resolver) Product ¶
func (r *Resolver) Product() ProductResolver
Product returns ProductResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
func (*Resolver) Template ¶
func (r *Resolver) Template() TemplateResolver
Template returns TemplateResolver implementation.
func (*Resolver) User ¶
func (r *Resolver) User() UserResolver
User returns UserResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { Entity() EntityResolver File() FileResolver Image() ImageResolver Mutation() MutationResolver Package() PackageResolver Place() PlaceResolver Post() PostResolver Product() ProductResolver Query() QueryResolver Template() TemplateResolver User() UserResolver }
type TemplateResolver ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.