diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-29 18:58:42 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-29 18:58:42 +0200 |
commit | 8fa0b258ac89781dae269790a4bde09cbcd2f324 (patch) | |
tree | b9bcf0826f5739f128de52123447cede23291c02 /graphql/resolvers/repo.go | |
parent | 6363518c85cbd8247a5f6507b8a1dd3903cfb71d (diff) | |
download | git-bug-8fa0b258ac89781dae269790a4bde09cbcd2f324.tar.gz |
cleaning
Diffstat (limited to 'graphql/resolvers/repo.go')
-rw-r--r-- | graphql/resolvers/repo.go | 26 |
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 +} |