Tom Redman
CCConvex Community
•Created by Tom Redman on 1/20/2025 in #support-community
Type error when NOT directly calling function (new to Convex 1.18.2)
I see in the update notes, it's not a good practice to call a function directly from another function.
However, when rectifying this (e.g. using
ctx.runQuery(myApiQuery)
vs myApiQuery()
I'm getting the stubborn "Function implicitly has return type 'any' because..." error.
Any idea why this is now upsetting the type system?
I feel like I'm missing something obvious!
And then I have this query:
25 replies
CCConvex Community
•Created by Tom Redman on 1/10/2025 in #support-community
Is this typically a bad practice? v.union(v.id("thisList"), v.id("thatList"))
I have two different types of lists that a user can select to take a singular action on (in my case, send emails).
I have a list of contacts that is a "segment", or a user can select the entire "list". A list is different from a segment, but the same action can be taken on both for all practical purposes.
I have my schema like this:
audience: v.union(v.id("mailchimpLists"), v.id("mailchimpSegments")),
Butttttt I'm immediately realizing that disambiguating this in a function seems hacky at best.
Is it better to do this, and then simply manage what's what further upstream?
This is fine as well, however, I find myself wanting to enforce that there must be one but not both.
I could do something like this:
But this still feels brittle.
I'm leaning toward the audienceType option, but would love to know if there's a better way, or if I'm missing something obvious with the v.union(v.id,v.id) idea.14 replies
CCConvex Community
•Created by Tom Redman on 12/6/2024 in #support-community
Has anybody solved implementing a trigger for _scheduled_functions changes?
I'm creating a job queue, in which I ctx.schedule jobs, and I'd like to update the resulting jobQueue record when it's complete (my jobQueue objects are different and used differently from the primitive _scheduled_functions).
I've tried the convex-helpers/trigger, but it doesn't seem to fire on the _scheduled_functions tables, as I don't update it directly.
Here's how I'm using the queue:
4 replies
CCConvex Community
•Created by Tom Redman on 12/6/2024 in #support-community
Not sure why this is throwing a "multiple paginated queries" error
Schema:
Error:
Calling once with arguments:
10 replies