Closed mbsanchez closed 1 year ago
@mbsanchez Thanks for the request. That would definitly be a useful addition. I'll see to it and report back.
@mbsanchez I implemented generation of the following schemas in the latest version:
ModelWithPartialRelations
ModelOptionalDefaultsWithPartialRelations
the last suggested schema ModelPartialWithPartialRelations
has already been implemented as ModelPartialWithRelations
. in this schema all fields should be optional.
I know we can generate types like ModelWithRelations ModelOptionalDefaultWithRelations ModelPartialWithRelations
I have a use case where I need to return the model with its relations but not all of them, it is possible to generate types like: ModelWithPartialRelations ModelOptionalDefaultWithPartialRelations ModelPartialWithPartialRelations
I know there is a type ModelPartialRelations so, it could be created as
export type ModelWithPartialRelations = z.infer<typeof ModelSchema> & ModelPartialRelation;
export type ModelOptionalDefaultWithPartialRelations = z.infer<typeof ModelOptionalDefaultsSchema> & ModelPartialRelation;
export type ModelPartialWithPartialRelations = z.infer<typeof ModelPartialSchema> & ModelPartialRelation;
thank you!