$set returns Promise<unknown>
Versions
- sequelize: 5.6.1
- sequelize-typescript: 1.0.0-beta.1
- typescript 3.4.3
I'm submitting a ... [x] bug report [ ] feature request
Actual behavior: The $set method on a model returns a promise of type unknown.
Expected behavior: According to sequelize's included types this method should return a promise of type ``
Steps to reproduce: Just peek into the model.ts file and also into sequelize's types
Hey @c8r821, this is intentionally set to unknown. First, $set and set doesn't have the same purpose. $set is explicitly used for setting relational data (see this). Additionally I wasn't able to narrow down a specific type - Which means for one-to-one sequelize resolves with this type, for one-to-many with another and sometimes under specific circumstances with some unexpected type. That's why unknown is used.
What do you think? Have I overseen something? Thanks for your help
Okay, I understand. Is the recommended way of dealing with this just to as MyType the result then?
Sorry for the misunderstanding!
@c8r821 Yes, if you're sure with the type, just cast it like you mentioned :)