convex-helpers/packages/convex-helpers/s...

I'm trying to create my own version of the CRUD helper from convex-helpers, but was having some trouble getting handler function argument types to work out correctly. I looked and saw that convex-helpers uses a type assertion to get it to work: https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/server/crud.ts#L94-L95

I was curious about why the type assertion is needed here? Shouldn't TypeScript be able to infer the correct type of the arguments, or are we running into some kind of limitation?
GitHub
A collection of useful code to complement the official packages. - get-convex/convex-helpers
Was this page helpful?