Function to generate a query string instead of using a module.