Kervin Vasquez
11/19/2021, 7:36 AMusers should I just be returning ctx.db.users.findMany() ? Could this approach have repercussions in performance given that it would be fetching all records ? I'm just not sure what return ctx.users.resolveForConnection(root, args, ctx, info) means in the example.Korzun
11/19/2021, 12:14 PMfindMany will have some performance implications. I recommend implementing cursor-based pagination directly within the findMany which works really well with Relay , something like this:
ctx.db.users.findMany({
cursor: afterUuid ? { uuid: afterUuid } : undefined,
take: first + 1,
skip: afterUuid ? 1 : undefined,
})Kervin Vasquez
11/20/2021, 5:59 AM