resolve(parent, args){ let author ={ name: args.name, age: args.age, id: args.id }; authors.push(author) console.log("Authors",authors); return author; }
axios .post('http://localhost:3000/users', { firstName: args.firstName, age: args.age, }) .then(resp => resp.data)
resolve(parent, args) { let author = new Author({ name: args.name, age: args.age }); return author.save(); }
resolve(parentValue, args) { const payload = { firstName: args.firstName, age: args.age, companyId: args.companyId } return axios.default.put(`http://localhost:3000/users/${args.id}`, payload) .then(({ data }) => data); }
resolve(parent,args, context, info){ console.log(parent, args, context, info); let author = new Author({ name:args.name, age:args.age }); return author.save(); }
resolve(parentValue, args) { const payload = { firstName: args.firstName, age: args.age, companyId: args.companyId } return axios.default.post(`http://localhost:3000/users`, payload) .then(({ data }) => data); }
resolve(parent, args){ let author ={ name: args.name, age: args.age, id: args.id }; authors.push(author) console.log("Authors",authors); return author; }