We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0e4703 commit 7de2f00Copy full SHA for 7de2f00
server/src/resolvers/Query.js
@@ -1,13 +1,13 @@
1
async function feed(parent, args, ctx, info) {
2
- const { filter, first, skip } = args // destructure input arguments
+ const { filter, first, skip, orderBy } = args // destructure input arguments
3
const where = filter
4
? { OR: [{ url_contains: filter }, { description_contains: filter }] }
5
: {}
6
7
const allLinks = await ctx.db.query.links({})
8
const count = allLinks.length
9
10
- const queriedLinkes = await ctx.db.query.links({ first, skip, where })
+ const queriedLinkes = await ctx.db.query.links({ first, skip, orderBy, where })
11
12
return {
13
linkIds: queriedLinkes.map(link => link.id),
0 commit comments