basic validation for all query types