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

Use maketypes library for json-to-ts and json-to-zod transformations. #402

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EllAchE
Copy link

@EllAchE EllAchE commented May 28, 2024

There are limitations to the currenty json-to-zod and json-to-ts libraries in use. I raised one specific issue in #401, but others include using any over union types, using null where undefined is appropriate etc.

Personally I think the maketypes library is a better default option and should just replace the current options, but being able to toggle between underlyings is also a viable approach here, should we want to preserve legacy behavior.

Lastly because of the library chosen I had to disable the noUnusedParamaters check in tsconfig.json.

Copy link

vercel bot commented May 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
transform ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 7:16am

@dirtycajunrice
Copy link
Collaborator

Hey! Thanks for the pull request!
Heads up this is just a friendly notice to let you know I will be helping out with the project and reviewing approvals. I am currently refactoring the app to nextjs 14, so modifications of your PR will be needed.

I will message again when that time has come 😄

@EllAchE
Copy link
Author

EllAchE commented Jul 14, 2024

Hey! Thanks for the pull request! Heads up this is just a friendly notice to let you know I will be helping out with the project and reviewing approvals. I am currently refactoring the app to nextjs 14, so modifications of your PR will be needed.

I will message again when that time has come 😄

Thanks for the response and great to hear that this repo is active again! Assuming this is just a message you issued on all of the open pull requests here, but what in this PR would need to be modified to support Next?

I'm also happy to help maintain, responded to this issue as well. #393

The feature I think would be useful & happy to help with to build would be enabling "to -> from" support.

I.e. currently it's possible to do graphql -> typescript & typescript -> zod, but graphql -> zod is not supported. Letting the user chain the mappings we could enable support for graphql -> zod, admittedly at risk of more bugs. But it's at least something I would use to go json -> ts -> zod

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

Successfully merging this pull request may close these issues.

2 participants