#findById is bad typed on v3.0.0-beta.102. Should I open an issue?

1 messages · Page 1 of 1 (latest)

autumn rivet
#

Hi, the return type of this function doesn't consider the case where the data doesn't exist. If the entry is deleted from the database or simply there is not an entry with the provided ID, it the function should return null or undefined.

Instead, it throws an error if the entry is not there. So I had to make a try-catch block to return null if that's the case. There is not a findFirst function.

wide steppeBOT
hardy wraith
#

Try passing disableErrors: true with the args

autumn rivet
#

Still getting the same type

hardy wraith
#

As of now, that type does not take that property into account, but I agree, it should.

#

I will open an issue