Support obscuring errors from relationship helpers
I was looking at using the helpers, which I really want to do via npm rather than copying code, and one drawback is they throw application errors when a value isn't found. Would be cool if this were optional. Not sure how ConvexError works, maybe I can just wrap in my own try/catch and rethrow a regular error?
3 Replies
I added
getAllWithNulls
and getOneOrNullFrom
since the default behavior seemed to be not wanting | null
in the type (in my usage at least)
getManyFrom
already just returns a []
if there aren't any. getManyVia
can choke if you have a join table with an entry pointing to a missing value but that seems like a bug generally so I didn't prioritize getManyOrNullVia
lmk if you'd want anything else!Ah of course! I'll use those, thank you
@Convex AI Helper Bot just testing to see if you're active in support threads
@Convex AI Helper Bot how do I write a query
Haha, the bot was not set up to answer questions it is tagged in (and I've turned it off for now).
(on the original topic of this thread, we agreed with Ian that these helpers should not be using application errors)