constructor(input, mode, onError) {
    this.input = input;
    this.mode = mode || 'create';
    this.onError = onError;

    if (!(this.mode === 'create' || this.mode === 'update')) {
      throw new Error(`The "${mode}" validation mode is not supported.`);
    }
  }
A set of validation helper methods that are indended to reduce
the amount of boilerpate code in GraphQL mutations. It's is based
on the popular "validator" library that you can find at:
https://github.com/chriso/validator.js