Type error after upgrading from 1.18 to 1.26
Hi, I have a type that was working fine until I upgraded convex to the latest, any suggestion on what I should update my type to?
error:
getByGroup
is defined like this
4 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
There is no linting error in my file but my build fails because of that
Got my answer, need to replace with
export type EventsArray = typeof api.events.getByGroup._returnType;
Glad that you found an answer.
On a side note, I noticed that you're using
.filter
on the query to isolate documents for a specific group. Be aware that this will do a full table scan, which could become expensive over time. I recommend adding an index on the group
field to make the query much more efficient.Indexes | Convex Developer Hub
Speed up queries with database indexes
Good spotting! I need to refactor that. That was one of the very first query I implemented with convex a year ago, most of the queries now are using indexes but I didn't refactor the old ones.
One more item on the todo list 😅
I'll also use the helpers for querying the relations