aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/resolvers/repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-29 18:58:42 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-29 18:58:42 +0200
commit8fa0b258ac89781dae269790a4bde09cbcd2f324 (patch)
treeb9bcf0826f5739f128de52123447cede23291c02 /graphql/resolvers/repo.go
parent6363518c85cbd8247a5f6507b8a1dd3903cfb71d (diff)
downloadgit-bug-8fa0b258ac89781dae269790a4bde09cbcd2f324.tar.gz
cleaning
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
+}