sysgears / apollo-universal-starter-kit

Apollo Universal Starter Kit is a SEO-friendly, fully-configured, modular starter application that helps developers to streamline web, server, and mobile development with cutting-edge technologies and ultimate code reuse.
https://apollokit.org
MIT License
1.68k stars 323 forks source link

Use yup for form validation #1149

Open verdverm opened 5 years ago

verdverm commented 5 years ago

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

larixer commented 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.