Mutation to update the session

This commit is contained in:
Luis Fernando Molina committed 2018-10-06 15:27:19 +02:00
1 parent 14bde55009
commit 9e6aa92688
1 file changed
+20
+20
View File
@@ -283,6 +283,26 @@ const Mutation = new GraphQLObjectType({
referrerId: args.referrerId
}
return User.update(key, updatedUser)
}
},
updateSessionToken: {
type: UserType,
args: {
authId: {type: GraphQLString},
sessionToken: {type: GraphQLString}
},
resolve (parent, args) {
console.log('Request Received', args)
let key = {
authId: decodeURI(args.authId)
}
console.log('Key', key)
console.log('decode', decodeURI(args.authId))
let updatedUser = {
sessionToken: args.sessionToken
}
return User.update(key, updatedUser)
}
}