diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-03-29 11:21:03 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-03-29 11:21:03 -0400 |
| commit | 75abf43dccc0145fca14217e948ea07a81afe8ec (patch) | |
| tree | 0e84dbbed0003d5ecc4df364fa491435793b1e79 /backend/src | |
| parent | 65c524251d49ade9d44a62337f3c1c1fed6eedd0 (diff) | |
apooolooo
Diffstat (limited to 'backend/src')
| -rw-r--r-- | backend/src/index.js | 5 | ||||
| -rw-r--r-- | backend/src/resolvers/Mutation.js | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/backend/src/index.js b/backend/src/index.js index a37e1f7..df5eb29 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -2,6 +2,11 @@ const createServer = require('./createServer'); const server = createServer(); +server.express.use((req, res, next, db) => { + console.log('MIDDLEWARE!'); + next(); +}); + server.start({ port: 4444 }, deets => { console.log(`Server is running on http://localhost:${deets.port}`); }); diff --git a/backend/src/resolvers/Mutation.js b/backend/src/resolvers/Mutation.js index e4d568d..35037b8 100644 --- a/backend/src/resolvers/Mutation.js +++ b/backend/src/resolvers/Mutation.js @@ -177,6 +177,7 @@ const mutations = { }); if (existingCartItem) { + console.log('Existing'); return ctx.db.mutation.updateCartItem( { where: { id: existingCartItem.id }, @@ -278,20 +279,16 @@ const mutations = { }, async updateUser(parent, args, ctx, info) { const userId = getUserId(ctx); - console.log(userId); const updatedUser = await ctx.db.mutation.updateUser({ data: args, where: { id: userId }, }); - console.log(updatedUser); return updatedUser; }, async updatePermissions(parent, args, ctx, info) { const userId = getUserId(ctx); - await wait(20000); const currentUser = await ctx.db.query.user({ where: { id: userId } }, info); - console.log(currentUser); if (!currentUser) throw new Error('You Must be logged in to updat permissions!'); hasPermission(currentUser, ['ADMIN', 'PERMISSIONUPDATE']); return ctx.db.mutation.updateUser( |
