def METHOD_NAME(api_url_template, github_repo):
    """
    Like `query_github` but return a generator by repeatedly
    iterating until no link to next page.
    """
    fqdn, path = github_api_url(api_url_template, github_repo,
                                per_page=GITHUB_PER_PAGE_MAX)
    auth = (github_repo.token, "x-oauth-basic") if github_repo.token else None
    response = None
    while True:
        if response is not None:
            # it means this is not the first iter
            if "link" not in response.headers:  # type: ignore[unreachable]
                break
            # following next link
            # https://developer.github.com/v3/#pagination
            match = re.match(r'.*<([^>]+)>; rel="next"', response.headers["link"])
            if not match:
                break
            path = match.group(1)
        response = interwebs.get(fqdn, 443, path, https=True, auth=auth)
        validate_response(response)
        if response.payload:
            for item in response.payload:
                yield item
        else:
            break