1package resolvers
2
3import (
4 "context"
5 "github.com/MichaelMure/git-bug/bug"
6 "github.com/MichaelMure/git-bug/cache"
7 "github.com/MichaelMure/git-bug/graphql/models"
8)
9
10type repoResolver struct {
11 cache cache.Cacher
12 repo cache.RepoCacher
13}
14
15func (repoResolver) AllBugs(ctx context.Context, obj *repoResolver, input models.ConnectionInput) (models.BugConnection, error) {
16 panic("implement me")
17}
18
19func (repoResolver) Bug(ctx context.Context, obj *repoResolver, prefix string) (*bug.Snapshot, error) {
20 b, err := obj.repo.ResolveBugPrefix(prefix)
21
22 if err != nil {
23 return nil, err
24 }
25
26 return b.Snapshot(), nil
27}