feat: GraphQL mutations for folder, group, tag, user

This commit is contained in:
NGPixel
2017-08-13 20:33:06 -04:00
parent 1405b822f4
commit 840eb7e705
9 changed files with 163 additions and 5 deletions

View File

@@ -6,9 +6,11 @@
module.exports = db => {
db.User.belongsToMany(db.Group, { through: 'userGroups' })
db.Group.belongsToMany(db.User, { through: 'userGroups' })
db.Group.hasMany(db.Right, { as: 'groupRights' })
db.Document.hasMany(db.Tag, { as: 'documentTags' })
db.Group.hasMany(db.Right)
db.Document.belongsToMany(db.Tag, { through: 'documentTags' })
db.Tag.belongsToMany(db.Document, { through: 'documentTags' })
db.File.belongsTo(db.Folder)
db.Folder.hasMany(db.File)
db.Comment.belongsTo(db.Document)
db.Comment.belongsTo(db.User, { as: 'author' })
}