From eabff7cd396d1f37ceb929e666f082ce57f07919 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 2 Feb 2018 15:23:20 -0500 Subject: updateS --- backend/src/resolvers/Query.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'backend/src/resolvers/Query.js') 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); -- cgit v1.3