Open verdverm opened 5 years ago
@verdverm yup
-like validation syntax and more complex possibilities is a good idea, thank you for raising it Tony. We need not only validation, we need single source of truth schema, which can be used for GraphQL-types generation, SQL tables generation, SQL queries building, forms generation, etc, etc. Partly we work on this here:
https://github.com/sysgears/apollo-universal-starter-kit/pull/524
and here:
https://github.com/sysgears/domain-schema
We don't have yup-like syntax yet in domain-schema
, but we think about adding it. We will not be able to use yup
itself, because we need more than just complex validation, but the idea about its syntax is great.
There is an internal validation which is limited, Formik recommends using the yup validation library which supports more complex possibilities.
https://jaredpalmer.com/formik/docs/guides/validation#validationschema