magento / graphql-ce

[ARCHIVED] Please use magento/magento2 project
https://github.com/magento/magento2
Open Software License 3.0
131 stars 156 forks source link

Fixed changing cart item quantity using updateCartItems mutation #928

Closed rogyar closed 5 years ago

rogyar commented 5 years ago

Description (*)

This PR fixes updateCartItems behavior in terms of changing item quantity. It looks like after some refactoring we lost the saving operation upon changing item qty (without changing other item's data).

Fixed Issues (if relevant)

  1. 927 : Update quantity for updateCartItems mutation does not work

Manual testing scenarios (*)

  1. Create empty cart
mutation {
  createEmptyCart
}
  1. Add a simple product to the cart
mutation {
  addSimpleProductsToCart(input: {
    cart_id: "$maskedCartId"
    cart_items: [
      {
        data: {
          quantity: 3,
          sku: "simple"
        }
      }
    ]
  }) {
    cart {
      items {
        id
        quantity
        product {
          name
        }
      }
    }
  }
}
  1. Change the quantity of the added item using updateCartItems mutation
mutation {
  updateCartItems(input: {
    cart_id:"$maskedCartId"
    cart_items: [
      {
        cart_item_id: $itemId
        quantity: 5
      }
    ]
  }) {
    cart {
      items {
        id
        quantity
        product {
          name
        }
      }
    }
  }
}
  1. Retrieve the cart contents via separate query
{
  cart(cart_id:"$maskedCartId") {
    items {
      id
      quantity
      product {
        name
      }
    }
  }
}
lenaorobei commented 5 years ago

@rogyar could you please cover this case with api-functional test?

rogyar commented 5 years ago

Sure, working on it

magento-engcom-team commented 5 years ago

Hi @lenaorobei, thank you for the review. ENGCOM-5864 has been created to process this Pull Request :eight_spoked_asterisk: @lenaorobei, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests
lenaorobei commented 5 years ago

Unfortunately need to close because the issue was fixed by internal team in 2.3.3-develop branch.