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

include enum-values into generated files instead of importing them #108

Open
michiim opened this issue Apr 21, 2022 · 2 comments
Open

include enum-values into generated files instead of importing them #108

michiim opened this issue Apr 21, 2022 · 2 comments

Comments

@michiim
Copy link

michiim commented Apr 21, 2022

I would like to use the generated schema-files also in my frontend (and not only in the backend, where these files are generated). But there is no (easy) way to copy them to my frontend project, because enum values are imported from '@prisma/client'. If these values were not imported by prisma client, but included, these files would be "exportable" to another project without any changes.

If you also like the idea of including enum values into the generated files, I would make a pull request.

@CarterGrimmeisen
Copy link
Owner

Hmmm. Fair point, I can imagine it would be fairly easy to generate another file and zod schema for the enum and then simply use that in place of the import from the Prisma client. A PR would be appreciated for sure!

@chrishoermann
Copy link

I'm late to the show but this should be possible with my zod-prisma-types generator.

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

3 participants