Documentation ¶
Index ¶
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewHandler(repo pg.Repository, app app.App, auth auth.AuthService) http.Handler
- func NewPlaygroundHandler(endpoint string) http.Handler
- type ComplexityRoot
- type Config
- type CreateListItemInput
- type DirectiveRoot
- type ItemInput
- type ListHeartAggregate
- type ListHeartResolver
- type ListInput
- type ListItemInput
- type ListItemResolver
- type ListResolver
- type LoginInput
- type LogoutOutput
- type MutationResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
- type UserInput
- type UserResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewHandler ¶
func NewHandler(repo pg.Repository, app app.App, auth auth.AuthService) http.Handler
NewHandler returns a new graphql endpoint handler.
func NewPlaygroundHandler ¶
NewPlaygroundHandler returns a new GraphQL Playground handler.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Item struct { ID func(childComplexity int) int Name func(childComplexity int) int Source func(childComplexity int) int } List struct { Hearts func(childComplexity int) int ID func(childComplexity int) int Items func(childComplexity int) int Name func(childComplexity int) int User func(childComplexity int) int } ListHeart struct { ID func(childComplexity int) int List func(childComplexity int) int User func(childComplexity int) int } ListHeartAggregate struct { ByCurrentUser func(childComplexity int) int Count func(childComplexity int) int Hearts func(childComplexity int) int } ListItem struct { Collected func(childComplexity int) int ID func(childComplexity int) int Item func(childComplexity int) int Quantity func(childComplexity int) int } LogoutOutput struct { Succeeded func(childComplexity int) int UserID func(childComplexity int) int } Mutation struct { CreateList func(childComplexity int, data ListInput) int CreateListItem func(childComplexity int, listItemData CreateListItemInput) int DeleteItem func(childComplexity int, id int64) int DeleteList func(childComplexity int, id int64) int DeleteUser func(childComplexity int, id int64) int Heart func(childComplexity int, listID int64) int Login func(childComplexity int, data LoginInput) int Logout func(childComplexity int) int Refresh func(childComplexity int) int Register func(childComplexity int, data UserInput) int SetListItem func(childComplexity int, data ListItemInput) int UnsetListItem func(childComplexity int, id int64) int UpdateItem func(childComplexity int, id int64, data ItemInput) int UpdateList func(childComplexity int, id int64, data ListInput) int UpdateListItem func(childComplexity int, id int64, data ListItemInput) int UpdateUser func(childComplexity int, id int64, data UserInput) int } Query struct { Item func(childComplexity int, id int64) int Items func(childComplexity int) int List func(childComplexity int, id int64) int Lists func(childComplexity int) int Me func(childComplexity int) int User func(childComplexity int, id int64) int Users func(childComplexity int) int } User struct { Email func(childComplexity int) int ID func(childComplexity int) int Lists func(childComplexity int) int Name func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type CreateListItemInput ¶
type DirectiveRoot ¶
type DirectiveRoot struct { }
type ListHeartAggregate ¶
type ListHeartResolver ¶
type ListItemInput ¶
type ListItemResolver ¶
type ListResolver ¶
type LoginInput ¶
type LogoutOutput ¶
type MutationResolver ¶
type MutationResolver interface { Login(ctx context.Context, data LoginInput) (*pg.User, error) Register(ctx context.Context, data UserInput) (*pg.User, error) Refresh(ctx context.Context) (*pg.User, error) Logout(ctx context.Context) (*LogoutOutput, error) UpdateUser(ctx context.Context, id int64, data UserInput) (*pg.User, error) DeleteUser(ctx context.Context, id int64) (*pg.User, error) CreateList(ctx context.Context, data ListInput) (*pg.List, error) UpdateList(ctx context.Context, id int64, data ListInput) (*pg.List, error) DeleteList(ctx context.Context, id int64) (*pg.List, error) CreateListItem(ctx context.Context, listItemData CreateListItemInput) (*pg.Item, error) UpdateItem(ctx context.Context, id int64, data ItemInput) (*pg.Item, error) DeleteItem(ctx context.Context, id int64) (*pg.Item, error) SetListItem(ctx context.Context, data ListItemInput) (*pg.ListItem, error) UpdateListItem(ctx context.Context, id int64, data ListItemInput) (*pg.ListItem, error) UnsetListItem(ctx context.Context, id int64) (*pg.ListItem, error) Heart(ctx context.Context, listID int64) (*pg.List, error) }
type QueryResolver ¶
type QueryResolver interface { Me(ctx context.Context) (*pg.User, error) User(ctx context.Context, id int64) (*pg.User, error) Users(ctx context.Context) ([]pg.User, error) List(ctx context.Context, id int64) (*pg.List, error) Lists(ctx context.Context) ([]pg.List, error) Item(ctx context.Context, id int64) (*pg.Item, error) Items(ctx context.Context) ([]pg.Item, error) }
type Resolver ¶
type Resolver struct { Repository pg.Repository App app.App Auth auth.AuthService }
func (*Resolver) List ¶
func (r *Resolver) List() ListResolver
List returns ListResolver implementation.
func (*Resolver) ListHeart ¶
func (r *Resolver) ListHeart() ListHeartResolver
func (*Resolver) ListItem ¶
func (r *Resolver) ListItem() ListItemResolver
ListItem returns ListItemResolver implementation.
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns MutationResolver implementation.
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns QueryResolver implementation.
func (*Resolver) User ¶
func (r *Resolver) User() UserResolver
User returns UserResolver implementation.
type ResolverRoot ¶
type ResolverRoot interface { List() ListResolver ListHeart() ListHeartResolver ListItem() ListItemResolver Mutation() MutationResolver Query() QueryResolver User() UserResolver }
Click to show internal directories.
Click to hide internal directories.