(parent, args, context, info)
| 1 | async function feed(parent, args, context, info) { |
| 2 | const where = args.filter |
| 3 | ? { |
| 4 | OR: [ |
| 5 | { description: { contains: args.filter } }, |
| 6 | { url: { contains: args.filter } } |
| 7 | ] |
| 8 | } |
| 9 | : {}; |
| 10 | |
| 11 | const links = await context.prisma.link.findMany({ |
| 12 | where, |
| 13 | skip: args.skip, |
| 14 | take: args.take, |
| 15 | orderBy: args.orderBy |
| 16 | }); |
| 17 | |
| 18 | const count = await context.prisma.link.count({ where }); |
| 19 | |
| 20 | return { |
| 21 | id: 'main-feed', |
| 22 | links, |
| 23 | count |
| 24 | }; |
| 25 | } |
| 26 | |
| 27 | module.exports = { |
| 28 | feed |
nothing calls this directly
no outgoing calls
no test coverage detected