@types/sequelize package and had problems.Definitions by: in index.d.ts) so they can respond.According to the API reference, Model.findById no longer exists and Model.findByPk is the right way to fetch a record by id/primary key.
If I use findByPk typescript fails to compile.
If I use findById I get a deprecation warning from Sequelize.
Not sure if this is related to the new API introduced by Sequelize 4
Seems like this is a deprecation made as preparation for Sequelize 5.
See: https://github.com/sequelize/sequelize/commit/1bc8b0e82d4635ff22cbd4c048c042fed30a036f
The release (v4.41.0) containing it is 6 days old, so findByPk is not that old in v4 yet.
So is there anything we can do about it?
Already implemented
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sequelize/index.d.ts#L3954
Can we close this issue?
Most helpful comment
So is there anything we can do about it?