profile
viewpoint

Ask questionsDocs on integrating with other OSS

It would be nice to have docs on how to integrate zod with other OSS. This would help people:

  • identify whether zod will work well with their tech stack
  • figure out how to use zod with their tech stack
  • help zod validate its feature set. If the docs are hard to write, zod is probably missing something.

GraphQL

It seems like zod could be well suited for GraphQL validations. It would be handy to have a reference for the parallels of GraphQL types and their corresponding zod types, as well as any other suggestions for integrating zod into the GraphQL environment.

As a single small example:

union Fish = Salmon | Tuna | Trout
type Catch {
  fish: Fish!
}
const FishEnum = z.union([z.literal('Salmon'), z.literal('Tuna'), z.literal('Trout')]);
const Catch = z.object({
  fish: FishEnum,
});

Of course it's a bit less obvious when it comes to nullable types because GraphQL is nullable by default, and zod is required by default.

React PropTypes

Seems like an integration that would make sense for libraries. Similar docs like those for GraphQL could make sense.

formik

Formik has native support for Yup schemas. Docs on integrating zod with formik would be nice!

vriad/zod

Answer questions chrbala

I have a bit of progress on an example. It uses the in-progress zod transformations API and not everything works – don't rely on anything in the repo for now. I'm adding this repo to share progress here, but it shouldn't be trusted to be stable at this point.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List