From e6bc08516c71f441f6ea8878aa3bcef7bcab8917 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 16 Mar 2019 20:15:44 +0100 Subject: [PATCH] Renaming some arguments --- src/schema/mutations/EditStrategy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schema/mutations/EditStrategy.js b/src/schema/mutations/EditStrategy.js index a522b1441..f0eeaf247 100644 --- a/src/schema/mutations/EditStrategy.js +++ b/src/schema/mutations/EditStrategy.js @@ -8,16 +8,16 @@ import { StrategyInputType } from '../types/input'; const args = { id: { type: new GraphQLNonNull(GraphQLID) }, - newStrategy: { type: new GraphQLNonNull(StrategyInputType) }, + strategy: { type: new GraphQLNonNull(StrategyInputType) }, }; -const resolve = (parent, { id: _id, newStrategy }) => new Promise((res, rej) => { +const resolve = (parent, { id: _id, strategy: editedStrategy }) => new Promise((res, rej) => { Strategy.findOne({ _id }).exec((err, strategy) => { if (err) { rej(err); return; } - strategy = newStrategy; + strategy.subStrategies = editedStrategy.subStrategies; strategy.save((error) => { if (error) { rej(error); @@ -29,7 +29,7 @@ const resolve = (parent, { id: _id, newStrategy }) => new Promise((res, rej) => }); const mutation = { - editParticipant: { + editStrategy: { type: StrategyType, args, resolve,