def METHOD_NAME(
    delivery_attempts,
    staff_api_client,
    permission_manage_apps,
):
    # given
    staff_api_client.user.user_permissions.add(permission_manage_apps)
    variables = {
        "id": delivery_attempts["webhook_id"],
        "first": 3,
        "sortBy": {"field": "CREATED_AT", "direction": "ASC"},
    }
    # when
    response = staff_api_client.post_graphql(
        EVENT_DELIVERY_ATTEMPT_SORT_QUERY, variables=variables
    )
    content = get_graphql_content(response)
    deliveries_response = content["data"]["webhook"]["eventDeliveries"]["edges"][0]
    attempts_response = deliveries_response["node"]["attempts"]["edges"]
    # then
    assert attempts_response[0]["node"]["id"] == delivery_attempts["attempt_1_id"]
    assert attempts_response[1]["node"]["id"] == delivery_attempts["attempt_2_id"]