export type BankingProductDetailedOptionalDefaultsRelations = {
Bank?: BankOptionalDefaultsRelations | null;
additionalInformation?: AdditionalInfoDetailedOptionalDefaultsRelations | null; // This needs to be WithRelations
};
export type BankingProductDetailedOptionalDefaultsWithRelations = z.infer<typeof BankingProductDetailedOptionalDefaultsSchema> & BankingProductDetailedOptionalDefaultsRelations // This is missing the non relation data
export const BankingProductDetailedOptionalDefaultsWithRelationsSchema: z.ZodType<BankingProductDetailedOptionalDefaultsWithRelations> = BankingProductDetailedOptionalDefaultsSchema.merge(z.object({
Bank: z.lazy(() => BankOptionalDefaultsWithRelationsSchema).nullish(),
additionalInformation: z.lazy(() => AdditionalInfoDetailedOptionalDefaultsWithRelationsSchema).nullish(), // This is correct, but the Generics make TS not able to access the non relational data
}))
Without the With I could not access the non relational data, since Typescript does not know they exist
Let me know if there is anything I have not thought of by adding this, hope there is no downstream effects eg if there are not nested relations 🙏
Thanks for this awesome package and the always quick responses (it is Easter, so no expectations 😄 )
Hey Chris,
I ran into a bug in the latest PR.
I have nested relations.
Without the
With
I could not access the non relational data, since Typescript does not know they existLet me know if there is anything I have not thought of by adding this, hope there is no downstream effects eg if there are not nested relations 🙏
Thanks for this awesome package and the always quick responses (it is Easter, so no expectations 😄 )