Allow query to be a string and not only a Query object