Throwing a redirect inside a query
When throwing a redirect from a query, the throw gets caught and returns undefined instead. The inferred return type is wrong in this case, but when throwing other values the throw is not caught. Is the query function typing wrong, or am I using query wrong?
2 Replies
I don't think calling a
query
inside another query
or action
is supported, i'd suggest moving the server functions out and using them directly.
Thanks. I had searched for nested query both here and in the docs and I didn't find anything. If it isn't documented somewhere yet, could it be? My instinct was to nest queries because
queryThatThrows
is an expensive operation that is used in multiple other queries and caching it could help my application performance