Skip to content

Commit 58597fc

Browse files
authored
Merge pull request #24 from qucode1/patch-1
Add orderBy to feed query resolver
2 parents e0e4703 + 7de2f00 commit 58597fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/resolvers/Query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
async function feed(parent, args, ctx, info) {
2-
const { filter, first, skip } = args // destructure input arguments
2+
const { filter, first, skip, orderBy } = args // destructure input arguments
33
const where = filter
44
? { OR: [{ url_contains: filter }, { description_contains: filter }] }
55
: {}
66

77
const allLinks = await ctx.db.query.links({})
88
const count = allLinks.length
99

10-
const queriedLinkes = await ctx.db.query.links({ first, skip, where })
10+
const queriedLinkes = await ctx.db.query.links({ first, skip, orderBy, where })
1111

1212
return {
1313
linkIds: queriedLinkes.map(link => link.id),

0 commit comments

Comments
 (0)