'Retrieve a list of queries created by the current user.
:qparam number page_size: Number of queries to return
:qparam number page: Page number to retrieve
Responds with an array of :ref:`query <query-response-label>` objects.'

@require_permission('view_query')
def get(self):

    drafts = (request.args.get('drafts') is not None)
    results = models.Query.by_user(self.current_user)
    page = request.args.get('page', 1, type=int)
    page_size = request.args.get('page_size', 25, type=int)
    return paginate(results, page, page_size, (lambda q: q.to_dict(with_stats=True, with_last_modified_by=False)))
