bolt icon indicating copy to clipboard operation
bolt copied to clipboard

extending Null ignores additional validation rules

Open ex37 opened this issue 7 years ago • 0 comments

As long as I mainly use optional types, to be able to update individual properties, instead of passing whole object, I want to create an optional type, so instead of writing:

type User {
  id: String | Null;
  active: Boolean | Null;
  ....
}

I can do smth like:

type User {
  id: Str;
  active: Bool;
}
type Str extends Null {
  validate() { this.isString() }
}

When doing so, following is generated:

"id": {
  ".validate": "false"
},

In addition, would be nice to have ability to implement something like O<T>, i.e. O<String>, O<Boolean>

ex37 avatar Aug 30 '18 13:08 ex37