Types for resuing filters
Anyone know how to type a filter we may want to reuse?
Goal:
I can see that e.g. a query is a QueryInitializer or OrderedQuery but can't quite figure out how to type the parameters etc
5 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!
Although given the recommendation in best practices docs to not use
filter
maybe I should not be doing this
but also yeah filters are not recommended
Using TypeScript to Write Complex Query Filters
There’s a new Convex helper to perform generic TypeScript filters, with the same performance as built-in Convex filters, and unlimited potential.
Thank you!
For reference for anyone else who sees this, here's an exmaple i have using the convex helpers filter