twinlogix / typetta

Node.js ORM written in TypeScript for type lovers.
https://twinlogix.github.io/typetta/
Apache License 2.0
108 stars 4 forks source link

Add a way to express a domain validation rule #157

Open edobrb opened 2 years ago

edobrb commented 2 years ago

Example:

type Example @entity {
  field1: Int
  field2: Int
}

Either field1 or field2 must be defined but not both. The only way to do this now is through middleware. It would be a nice way to express the rule declaratively.

edobrb commented 2 years ago

Some idea from #220