summaryrefslogtreecommitdiffstats
path: root/backend/src/resolvers/Query.js
diff options
context:
space:
mode:
Diffstat (limited to 'backend/src/resolvers/Query.js')
-rw-r--r--backend/src/resolvers/Query.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/backend/src/resolvers/Query.js b/backend/src/resolvers/Query.js
index 9d9d142..a2eb749 100644
--- a/backend/src/resolvers/Query.js
+++ b/backend/src/resolvers/Query.js
@@ -1,18 +1,26 @@
const { getUserId, Context } = require('../utils');
+const { forwardTo } = require('prisma-binding');
const Query = {
+ items(parent, args, ctx, info) {
+ // check auth
+ return ctx.db.query.items({ ...args }, info);
+ },
+
+ itemsConnection: forwardTo('db'),
+
feed(parent, args, ctx, info) {
- return ctx.db.query.posts({ where: { isPublished: true } }, info);
+ return ctx.db.query.posts({}, info);
},
drafts(parent, args, ctx, info) {
- const id = getUserId(ctx);
+ // const id = getUserId(ctx);
const where = {
isPublished: false,
- author: {
- id,
- },
+ // author: {
+ // id,
+ // },
};
return ctx.db.query.posts({ where }, info);