get queries as a query string