Just like with authorization rules, we can validate data using functions. For example:
validators.js, defined as:
Let's say that we want every book's title to be in uppercase automatically on every read, we can pass a function to
@onRead directive on the
The result of the transformation is then returned to the user, or passed to the next
@onRead. The same composition mechanism applies to other types of directives that take function arguments, i.e.