diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-29 23:48:52 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-29 23:48:52 +0200 |
commit | 5b70e3452a4685112fd005fef0727930ebd2adaf (patch) | |
tree | 8ccc03847dd09d48f2c979772a6d0bb23fd8cbcc /graphql/resolvers/repo.go | |
parent | 64354c7ce3ff8d1c8c780a93b46c933781851edf (diff) | |
download | git-bug-5b70e3452a4685112fd005fef0727930ebd2adaf.tar.gz |
graphql: fix knot in the graphql/gqlgen usage
Diffstat (limited to 'graphql/resolvers/repo.go')
-rw-r--r-- | graphql/resolvers/repo.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go index 2031d7b6..26c5ebaa 100644 --- a/graphql/resolvers/repo.go +++ b/graphql/resolvers/repo.go @@ -3,20 +3,16 @@ package resolvers import ( "context" "github.com/MichaelMure/git-bug/bug" - "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/graphql/connections" "github.com/MichaelMure/git-bug/graphql/models" ) -type repoResolver struct { - cache cache.Cacher - repo cache.RepoCacher -} +type repoResolver struct{} -func (repoResolver) AllBugs(ctx context.Context, obj *repoResolver, input models.ConnectionInput) (models.BugConnection, error) { +func (repoResolver) AllBugs(ctx context.Context, obj *models.Repository, input models.ConnectionInput) (models.BugConnection, error) { // Simply pass a []string with the ids to the pagination algorithm - source, err := obj.repo.AllBugIds() + source, err := obj.Repo.AllBugIds() if err != nil { return models.BugConnection{}, err @@ -35,7 +31,7 @@ func (repoResolver) AllBugs(ctx context.Context, obj *repoResolver, input models edges := make([]models.BugEdge, len(lazyBugEdges)) for i, lazyBugEdge := range lazyBugEdges { - b, err := obj.repo.ResolveBug(lazyBugEdge.Id) + b, err := obj.Repo.ResolveBug(lazyBugEdge.Id) if err != nil { return models.BugConnection{}, err @@ -59,8 +55,8 @@ func (repoResolver) AllBugs(ctx context.Context, obj *repoResolver, input models return connections.StringCon(source, edger, conMaker, input) } -func (repoResolver) Bug(ctx context.Context, obj *repoResolver, prefix string) (*bug.Snapshot, error) { - b, err := obj.repo.ResolveBugPrefix(prefix) +func (repoResolver) Bug(ctx context.Context, obj *models.Repository, prefix string) (*bug.Snapshot, error) { + b, err := obj.Repo.ResolveBugPrefix(prefix) if err != nil { return nil, err |