Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inferred Types #74

Closed
cbs-l opened this issue Feb 9, 2023 · 4 comments
Closed

Inferred Types #74

cbs-l opened this issue Feb 9, 2023 · 4 comments

Comments

@cbs-l
Copy link

cbs-l commented Feb 9, 2023

Issue

I am wanting to generate the inferred type from our Prisma models as well as the Schema itself.
Currently I would have to create the types myself. These could simply just be one to ones of the generated Schema. Not sure if this is already available or I missed something.

@chrishoermann
Copy link
Owner

@luke-cbs since the types are based on the prisma types, could you not just use the pypes from the prisma index.d.ts?
But, if not, it is actually not that much work to add the inferred type to the model. I'll consider it on the next release.

@cbs-l
Copy link
Author

cbs-l commented Feb 10, 2023

So came across your library to generate the zod schemas for me based of the models and just create a single source of truth. Using the prisma types directly introduces other issues when passing types around that don't match and stuff. So at the moment I take your generated schema's and then just infer them myself. Was just trying to see if we could get that out the box.

@chrishoermann
Copy link
Owner

@luke-cbs in the latest version the inferred type is now added by default. It is named after the prima model. No Suffix.

@cbs-l
Copy link
Author

cbs-l commented Feb 11, 2023

You are a magician. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants