7 Replies
when I remove the return statement it all goes away
the mutation I'm calling that returns the plan id

These are annoying, we're weighing options for eliminated them.
this fixed it 🤷♂️

Does this go away if you type planId as
Id<'plans'>
?
yeah that
TypeScript gets unhappy about circular inference here: the return type of
- this function you're in the middle of depends on
- the type of api
which depends on
- the type of the function you're in the middle of
you still get typechecking if you annotate this (e.g. try changing the return type of createInitialPlan
, you'll get red squigglies if they don't match)so it's mainly just because I'm returning the ID plans from the mutation that typescript gets confused
ok well just adding the type of the variable isn't too bad for now
the expict annotation is the right way to solve here, it's just frustrating that that isn't documented and that it works until it doesn't