From 09e097e1bf32ad153c139e3f6befad9fb059fd6e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sun, 9 Sep 2018 20:21:49 +0200 Subject: cache: combine sorting and filtering into a query with its micro-DSL --- graphql/resolvers/repo.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'graphql/resolvers/repo.go') diff --git a/graphql/resolvers/repo.go b/graphql/resolvers/repo.go index 75c1307d..7922256f 100644 --- a/graphql/resolvers/repo.go +++ b/graphql/resolvers/repo.go @@ -20,7 +20,10 @@ func (repoResolver) AllBugs(ctx context.Context, obj *models.Repository, after * } // Simply pass a []string with the ids to the pagination algorithm - source := obj.Repo.AllBugsId(cache.OrderByCreation, cache.OrderAscending) + source := obj.Repo.QueryBugs(&cache.Query{ + OrderBy: cache.OrderByCreation, + OrderDirection: cache.OrderAscending, + }) // The edger create a custom edge holding just the id edger := func(id string, offset int) connections.Edge { -- cgit