resolvers-user.js 324 Bytes
Newer Older
NGPixel's avatar
NGPixel committed
1 2 3 4 5
'use strict'

/* global wiki */

module.exports = {
6 7 8 9 10 11 12 13 14
  Query: {
    users(obj, args, context, info) {
      return wiki.db.User.findAll({ where: args })
    }
  },
  Mutation: {
    createUser(obj, args) {
      return wiki.db.User.create(args)
    }
NGPixel's avatar
NGPixel committed
15
  },
16
  User: {
NGPixel's avatar
NGPixel committed
17 18 19 20 21
    groups(usr) {
      return usr.getGroups()
    }
  }
}