platform/graphql_schema/lib/src/validation_result.dart

22 lines
486 B
Dart
Raw Normal View History

2018-08-02 13:31:54 +00:00
part of graphql_schema.src.schema;
class ValidationResult<T> {
final bool successful;
final T value;
final List<String> errors;
2018-08-03 22:01:36 +00:00
ValidationResult._(this.successful, this.value, this.errors);
2018-08-02 13:31:54 +00:00
ValidationResult._ok(this.value)
: errors = [],
successful = true;
ValidationResult._failure(this.errors)
: value = null,
successful = false;
2018-08-03 22:01:36 +00:00
2018-08-04 19:18:53 +00:00
// ValidationResult<T> _asFailure() {
// return new ValidationResult<T>._(false, value, errors);
// }
}