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

don't generate redundant code #4

Closed
Morriz opened this issue May 31, 2022 · 4 comments
Closed

don't generate redundant code #4

Morriz opened this issue May 31, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Morriz
Copy link

Morriz commented May 31, 2022

Problem

Hi, all your objects/*.schema files contain redundant code. The top definition is always copied to be used in the exported Yup.object({....

Suggested solution

Just export like this:

export const UserUpdateInputObject = ...
...
export const UserUpdateInputObjectSchema = Yup.object(UserUpdateInputObject)
@Morriz
Copy link
Author

Morriz commented May 31, 2022

It would also be really awesome if you could generate indexes so that we can just import like this:

import { UserUpdateInputObjectSchema } from `*/gen/schemas`

@Morriz
Copy link
Author

Morriz commented May 31, 2022

I will create a separate issue for that ;)

@omar-dulaimi omar-dulaimi added the enhancement New feature or request label May 31, 2022
@omar-dulaimi omar-dulaimi self-assigned this May 31, 2022
@omar-dulaimi
Copy link
Owner

export const UserUpdateInputObject = ...
...
export const UserUpdateInputObjectSchema = Yup.object(UserUpdateInputObject)

This would be really cool if it works and doesn't show any errors. Hopefully it works!

@omar-dulaimi omar-dulaimi moved this from To do to In progress in Issues Progress Tracking May 31, 2022
@omar-dulaimi
Copy link
Owner

Fixed in 0.1.3

Issues Progress Tracking automation moved this from In progress to Done May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants