aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'graphql/resolvers/repo.go')
-rw-r--r--graphql/resolvers/repo.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go
new file mode 100644
index 00000000..14019b65
--- /dev/null
+++ b/graphql/resolvers/repo.go
@@ -0,0 +1,26 @@
+package resolvers
+
+import (
+ "context"
+ "github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/cache"
+)
+
+type repoResolver struct {
+ cache cache.Cacher
+ repo cache.RepoCacher
+}
+
+func (repoResolver) AllBugs(ctx context.Context, obj *repoResolver, input ConnectionInput) (BugConnection, error) {
+ panic("implement me")
+}
+
+func (repoResolver) Bug(ctx context.Context, obj *repoResolver, prefix string) (*bug.Snapshot, error) {
+ b, err := obj.repo.ResolveBugPrefix(prefix)
+
+ if err != nil {
+ return nil, err
+ }
+
+ return b.Snapshot(), nil
+}