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-08-27 13:15:41 +03:00
|
|
|
type RootResolver struct {
|
2018-09-02 16:45:14 +03:00
|
|
|
cache.MultiRepoCache
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func NewRootResolver() *RootResolver {
|
|
|
|
return &RootResolver{
|
2018-09-02 16:45:14 +03:00
|
|
|
MultiRepoCache: cache.NewMultiRepoCache(),
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (r RootResolver) Query() graph.QueryResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &rootQueryResolver{
|
2018-09-02 16:45:14 +03:00
|
|
|
cache: &r.MultiRepoCache,
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (r RootResolver) Mutation() graph.MutationResolver {
|
2018-07-30 02:36:41 +03:00
|
|
|
return &mutationResolver{
|
2018-09-02 16:45:14 +03:00
|
|
|
cache: &r.MultiRepoCache,
|
2018-07-30 02:36:41 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (RootResolver) AddCommentOperation() graph.AddCommentOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &addCommentOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (r RootResolver) Bug() graph.BugResolver {
|
2018-07-30 00:48:52 +03:00
|
|
|
return &bugResolver{}
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (RootResolver) CreateOperation() graph.CreateOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &createOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (RootResolver) LabelChangeOperation() graph.LabelChangeOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &labelChangeOperation{}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (r RootResolver) Repository() graph.RepositoryResolver {
|
2018-07-30 00:48:52 +03:00
|
|
|
return &repoResolver{}
|
2018-07-29 19:11:33 +03:00
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (RootResolver) SetStatusOperation() graph.SetStatusOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &setStatusOperationResolver{}
|
|
|
|
}
|
|
|
|
|
2018-08-27 13:15:41 +03:00
|
|
|
func (RootResolver) SetTitleOperation() graph.SetTitleOperationResolver {
|
2018-07-29 19:11:33 +03:00
|
|
|
return &setTitleOperationResolver{}
|
|
|
|
}
|