So i had a similar issue but with an object and the solution was to write it like this:
this.class.update(x => { let r = ({...x, selfCheckIn:!x!.selfCheckIn}) as ClassDTO return (val)?r:x }) Some More details here Github Response Source