0

Something wrong here, do you know what?

switchEventSellingStarted: async(_, {name, sellingStarted}) => {
      Event.findOne({name: name}, function (err, event) {
        event.sellingStarted = sellingStarted;
        event.save();
        return event;
      });
    }

enter image description here

János
  • 32,867
  • 38
  • 193
  • 353
  • try adding return before Event.findOne? – twcardenas Oct 17 '19 at 23:32
  • Don't mix callbacks with Promises. Your resolver should always return a value or a Promise that will resolve to a value; otherwise, it will resolve to null. See [Common Scenario #6](https://stackoverflow.com/a/56319138/6024220). – Daniel Rearden Oct 17 '19 at 23:50

0 Answers0