You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: Does sequelize-typescript support typed returns based on included associations? #1745
results in a return type that includes the patient object on it? And vice-versa, if I don't include the patient model, can I get a return type where the patient object is not defined? I have the associations defined with decorators on the appointment class but it seems to always assume that patient will be present on the appointment object.
I find myself in the same position, it would be very useful if appointment was a property of a Patient<Appointment> type but not Patient for example, not sure if this is even possible with TypeScript.
@ccmetz If this helps you at all, in the meantime you can resort to calling getters - these should resolve from memory if associated model was included, but will also lazy load if it wasn't, guaranteeing that the associated model will be resolved,
Activity
RudyBai commentedon Aug 27, 2025
I find myself in the same position, it would be very useful if
appointmentwas a property of aPatient<Appointment>type but notPatientfor example, not sure if this is even possible with TypeScript.@ccmetz If this helps you at all, in the meantime you can resort to calling getters - these should resolve from memory if associated model was included, but will also lazy load if it wasn't, guaranteeing that the associated model will be resolved,