Validation and User Errors in GraphQL Mutations
Konstantin Tarkus

Dislike this method ;)

GraphQL has build-in error system. So I recommend to use it. To return error from resolve method you may use:

resolve() {
 return Promise.reject(new Error(‘User with this email address already exists.’))

You may extend error object, eg. ValidationError. And provide to it field name or object with fieldNames and errors.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.