mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
845 B
46 lines
845 B
7 years ago
|
|
||
7 years ago
|
/* global WIKI */
|
||
7 years ago
|
|
||
|
module.exports = {
|
||
7 years ago
|
Query: {
|
||
|
users(obj, args, context, info) {
|
||
7 years ago
|
return WIKI.db.User.findAll({ where: args })
|
||
7 years ago
|
}
|
||
|
},
|
||
|
Mutation: {
|
||
|
createUser(obj, args) {
|
||
7 years ago
|
return WIKI.db.User.create(args)
|
||
7 years ago
|
},
|
||
|
deleteUser(obj, args) {
|
||
7 years ago
|
return WIKI.db.User.destroy({
|
||
7 years ago
|
where: {
|
||
|
id: args.id
|
||
|
},
|
||
|
limit: 1
|
||
|
})
|
||
7 years ago
|
},
|
||
|
modifyUser(obj, args) {
|
||
7 years ago
|
return WIKI.db.User.update({
|
||
7 years ago
|
email: args.email,
|
||
|
name: args.name,
|
||
|
provider: args.provider,
|
||
|
providerId: args.providerId,
|
||
|
role: args.role
|
||
|
}, {
|
||
|
where: { id: args.id }
|
||
|
})
|
||
|
},
|
||
|
resetUserPassword(obj, args) {
|
||
|
return false
|
||
|
},
|
||
|
setUserPassword(obj, args) {
|
||
|
return false
|
||
7 years ago
|
}
|
||
7 years ago
|
},
|
||
7 years ago
|
User: {
|
||
7 years ago
|
groups(usr) {
|
||
|
return usr.getGroups()
|
||
|
}
|
||
|
}
|
||
|
}
|