SHARE
TWEET

Untitled

a guest Feb 17th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Mutation = new GraphQLObjectType({
  2.   name: 'Mutation',
  3.   fields: {
  4.     addGadget: {
  5.       type: gadgetGraphQLType,
  6.       args: {
  7.         name: { type: GraphQLString },
  8.         release_date: { type: GraphQLString },
  9.         by_company: { type: GraphQLString },
  10.         price: { type: GraphQLString }
  11.       },
  12.       resolve(parent, args) {
  13.         const newGadget = new Gadget({
  14.           name: args.name,
  15.           release_date: args.release_date,
  16.           by_company: args.by_company,
  17.           price: args.price,
  18.         })
  19.  
  20.         return newGadget.save();
  21.       }
  22.     }, // add new mutation
  23.     updateGadget: {
  24.       type: gadgetGraphQLType,
  25.       args: {
  26.         id: { type: GraphQLString },
  27.         name: { type: GraphQLString },
  28.         release_date: { type: GraphQLString },
  29.         by_company: { type: GraphQLString },
  30.         price: { type: GraphQLString }
  31.       },
  32.       resolve(parent, args) {
  33.  
  34.       }
  35.     }
  36.   }
  37. })
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
 
Top