Akwatype supports scalar types by default, but it is sometimes necessary to define new ones to increase the expressiveness of models and to allow adding properties and controls to scalar fields.
Akwatype allows you to define your own scalar type based on the existing default types with the scalar as syntax
- scalar Age as Integer
- scalar SimpleDate as String
- scalar Activated as Boolean
it is also possible to associate default properties to the newly defined scalar.
The supported properties are those of the type akwatype on which the new scalar has been defined
example :
scalar SimpleDate as String{ minLength: 10 maxLength: 10 comment: "Simple date in ISO format" example:"2021-01-12" regex: "^\d{4}-([0]\d|1[0-2])-([0-2]\d|3[01])$" }
type Vehicle{ model:String brand:String purchaseDate:SimpleDate }