Add support for query dry runs

This adds support for doing a dry run of a query, where the query is submitted but not actually run. If the query is valid, no results are returned, but if it's invalid, a response containing the reason is returned.