aboutsummaryrefslogtreecommitdiffstats
path: root/mutations.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-02-17 21:08:22 -0800
committerAdam Soltys <[email protected]>2018-02-17 21:08:22 -0800
commit82ea50b1bfef490009afb48c4fcb7986c764886d (patch)
tree9041ddfbb6ad3b6ef5639275adb2aa5b21af7319 /mutations.js
parent5441b2fdd310153774eed6e335408253606a4d78 (diff)
downloadcoinos-server-82ea50b1bfef490009afb48c4fcb7986c764886d.tar.gz
coinos-server-82ea50b1bfef490009afb48c4fcb7986c764886d.zip
updateUser mutation
Diffstat (limited to 'mutations.js')
-rw-r--r--mutations.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/mutations.js b/mutations.js
index 70e5e300..0e8765d7 100644
--- a/mutations.js
+++ b/mutations.js
@@ -40,6 +40,17 @@ module.exports = (db, gqltypes, lnrpc) => {
return db['User'].create(user)
}
},
+ updateUser: {
+ type: gqltypes['users'],
+ args: {
+ user: {
+ type: UserInputType
+ }
+ },
+ resolve: async (root, { user }) => {
+ await db['User'].update(user, { where: { username: user.username } })
+ }
+ },
}
})
}