Renaming some arguments
This commit is contained in:
1 parent
7e58f01db1
commit
e6bc08516c
1 file changed
+4
-4
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user