2018-07-29 19:11:33 +03:00
|
|
|
package resolvers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/MichaelMure/git-bug/cache"
|
2018-07-30 00:48:52 +03:00
|
|
|
"github.com/MichaelMure/git-bug/graphql/graph"
|
2018-07-29 19:11:33 +03:00
|
|
|
)
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
type Backend struct {
|
2018-07-29 19:11:33 +03:00
|
|
|
cache.RootCache
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func NewBackend() *Backend {
|
|
|
|
return &Backend{
|
2018-07-29 19:11:33 +03:00
|
|
|
RootCache: cache.NewCache(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (r Backend) Query() graph.QueryResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &rootQueryResolver{
|
|
|
|
cache: &r.RootCache,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-30 02:36:41 +03:00
|
|
|
func (r Backend) Mutation() graph.MutationResolver {
|
|
|
|
return &mutationResolver{
|
|
|
|
cache: &r.RootCache,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (Backend) AddCommentOperation() graph.AddCommentOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &addCommentOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (r Backend) Bug() graph.BugResolver {
|
|
|
|
return &bugResolver{}
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (Backend) CreateOperation() graph.CreateOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &createOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (Backend) LabelChangeOperation() graph.LabelChangeOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &labelChangeOperation{}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (r Backend) Repository() graph.RepositoryResolver {
|
|
|
|
return &repoResolver{}
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (Backend) SetStatusOperation() graph.SetStatusOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &setStatusOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-07-30 00:48:52 +03:00
|
|
|
func (Backend) SetTitleOperation() graph.SetTitleOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &setTitleOperationResolver{}
|
|
|
|
}
|