I’ve been exploring validation recently and think adding Match.AllOf (AND) and Match.OnlyOneOf (XOR) to compliment the existing Match.OneOf (OR) could be useful. I’d be willing to submit a PR if others think they’d be helpful.
If you‘d prefer not to have them, that’d be good to know too.
If you have other ideas on what would be useful, please post them below. Thanks!
I’d honestly look at Zod. In my experience you’re probably going to be using check to validate method and publication parameters. In which case you should check out zodern:relay which uses Zod and has nice API for setting up and working with publications, subscriptions and methods.
to answer your other question, yes… I have it validating methods, forms in the browser (using react-hook-forms), publications, subscriptions, and i have it wired up to simple schema to validate database writes. Define the schema in zod, and get runtime checks + type safety enforced consistently across the entire app. Very cool.
Once I get some time, I am going to make a sample app showing the setup.