We now have mutations to addVolunteers (graphql):
var addVolunteering = {
type: graphql.GraphQLList(Volunteering),
args: {
user_id: {
type: new graphql.GraphQLNonNull(graphql.GraphQLString)
},
event_id:{
type: new graphql.GraphQLNonNull(graphql.GraphQLString)
}
},
resolve: function (source, args) {
return new Promise((resolve, reject) => {
var query = INSERT INTO volunteering(user_id,event_id) VALUES(${args.user_id},${args.event_id});
logger.info(filename +"Trying to query '"+query+"'")
db.run(query, function(err, rows) {
if(err){
logger.error(err);
reject(err);
}
logger.info(filename +" '"+query+"' successfully queried")
resolve(rows);
});
});
}
}
Log in or sign up for Devpost to join the conversation.