def METHOD_NAME(
    direction,
    staff_api_client,
    gift_card,
    gift_card_expiry_date,
    gift_card_used,
    non_shippable_gift_card_product,
    shippable_gift_card_product,
    permission_manage_gift_card,
):
    # given
    gift_card.product = non_shippable_gift_card_product
    gift_card_expiry_date.product = shippable_gift_card_product
    gift_card_used.product = None
    gift_card_list = [gift_card, gift_card_expiry_date, gift_card_used]
    GiftCard.objects.bulk_update(gift_card_list, ["product"])
    variables = {
        "sortBy": {
            "direction": direction,
            "field": "PRODUCT",
        }
    }
    # when
    response = staff_api_client.post_graphql(
        QUERY_GIFT_CARDS, variables, permissions=[permission_manage_gift_card]
    )
    # then
    if direction == "DESC":
        gift_card_list.reverse()
    content = get_graphql_content(response)
    data = content["data"]["giftCards"]["edges"]
    assert len(data) == 3
    assert [card["node"]["id"] for card in data] == [
        graphene.Node.to_global_id("GiftCard", card.pk) for card in gift_card_list
    ]