Trying to execute as Query, but it is defined as Mutation.
hi, I am a new user on Convex. On my first try on creating my side project. I have a couple of issues with Convex.
I have created users.ts file as you can see on my code screenshot, but I have two different errors at the same time. One says trying to execute 'getMe' as Query, but it is defined as Mutation, and the another one says 'getUsers' is unauthorized. I am successfully logged in with clerk and convex using webhook by the way. Please help if someone knows this error.
2 Replies
Have you tried calling the
getMe
query from the convex console? My troubleshooting approach would be:
- Comment out auth checking code
- See if the query works from your next app
- If not, try calling from the convex consolei just fixed it! Thanks for your comment. it turned out i just needed to add "{isAuthenticated} = useConvexAuth()" to run the function. Thanks!