Skip to content

Commit

Permalink
avoid calling convex functions directly (#33)
Browse files Browse the repository at this point in the history
Avoid calling convex functions -- queries/mutations/actions/httpactions -- directly, as if they were js functions. Instead, their _handler property is the js function, if it exists.

This avoids a new console.warn which was added to "convex/server" which happens if you call a registered query/mutation/action/httpaction directly.

I added some types, but i'm not sure if this makes it actually safer. the main benefit was not needing casts to make the PublicHttpAction type flow through from router.lookup

Co-authored-by: Sarah Shader <[email protected]>

---------

Co-authored-by: Sarah Shader <[email protected]>
  • Loading branch information
ldanilek and sshader authored Jan 3, 2025
1 parent 2f4e925 commit 44d1d74
Showing 1 changed file with 148 additions and 74 deletions.
Loading

0 comments on commit 44d1d74

Please sign in to comment.