git-bug/graphql/resolvers/root.go

57 lines
1.2 KiB
Go
Raw Normal View History

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