add `validate` to the query level