SHARE
TWEET

Untitled

a guest Aug 18th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var schema = buildSchema(`
  2.   type Mutation {
  3.     updateUserInfo(id: Int, name: String, email: String, job_title: String) : Boolean
  4.     createUser(name: String, email: String, job_title: String) : Boolean
  5.     deleteUser(id: Int) : Boolean
  6.   }
  7. `);
  8.  
  9. var root = {
  10.   updateUserInfo: (args, req) => queryDB(req, "update users SET ? where id = ?", [args, args.id]).then(data => data),
  11.   createUser: (args, req) => queryDB(req, "insert into users SET ?", args).then(data => data),
  12.   deleteUser: (args, req) => queryDB(req, "delete from users where id = ?", [args.id]).then(data => data)
  13. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top