diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-02 16:36:48 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-02 16:36:48 +0200 |
commit | 0728c0050d82171659474900c407e1b6dcee43a5 (patch) | |
tree | 73473697a596bb0e93b30ab9a68fd25e7c3af98c /graphql/resolvers/repo.go | |
parent | e3c445fa85db65b084580a38b919f17b8f8c2b68 (diff) | |
download | git-bug-0728c0050d82171659474900c407e1b6dcee43a5.tar.gz |
cache: provide a generic bug sorting function
Diffstat (limited to 'graphql/resolvers/repo.go')
-rw-r--r-- | graphql/resolvers/repo.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go index fc82faf4..75c1307d 100644 --- a/graphql/resolvers/repo.go +++ b/graphql/resolvers/repo.go @@ -4,6 +4,7 @@ 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" ) @@ -19,7 +20,7 @@ func (repoResolver) AllBugs(ctx context.Context, obj *models.Repository, after * } // Simply pass a []string with the ids to the pagination algorithm - source := obj.Repo.AllBugOrderById() + source := obj.Repo.AllBugsId(cache.OrderByCreation, cache.OrderAscending) // The edger create a custom edge holding just the id edger := func(id string, offset int) connections.Edge { |