Test queries in the browser
Is there a way to hijack the WebSocket and send messages in the network tab (or in another app) via the WebSocket without needing to code this into your app, to test your backend queries?
7 Replies
You can assign the ConvexClient to a global variable and run things like
in the console
or if you dont' want to modify your code you can use the debugging to store it to a global varible
and with data I can do all kind of cool things then? like data.sendQuery or similar?
data is just going to be the result
client is the ConvexClient
ah ok, sorry
you can even reach inside the ConveClient and enumerate subscribed queries etc., but if there aren't typescript types exposed for it these are not stable APIs
Class: ConvexReactClient | Convex Developer Hub
react.ConvexReactClient
sounds, good, I will definitely try this one out. Especially for security testing as I want to write some garbish or dangerous queries and this is an easy way for me to check how my queries respond