-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GRAPHQL] Made the attribute destination_cart_id
for mergeCarts mutation not required.
#30633
Conversation
Hi @andrewbess. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
…rgeCarts mutation not required.
@magento run all tests |
@magento run all tests |
} | ||
|
||
$guestMaskedCartId = $args['source_cart_id']; | ||
$customerMaskedCartId = $args['destination_cart_id']; | ||
$customerMaskedCartId = $customerMaskedCartId ?? $args['destination_cart_id']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's magic in 7.4 that allows us to turn it into
$customerMaskedCartId = $customerMaskedCartId ?? $args['destination_cart_id']; | |
$customerMaskedCartId ??= $args['destination_cart_id']; |
But let's leave it as it is to preserve compatibility with 7.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andrewbess. Looks great, thanks. Please, check my suggestion regarding the test below
@@ -192,9 +192,6 @@ public function testMergeCartsWithEmptySourceCartId() | |||
*/ | |||
public function testMergeCartsWithEmptyDestinationCartId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would ask you to cover this case with an additional test. The test will assert that without providing the destination cart id, the current cart is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rogyar
Thank you for your review.
I extended the tests.
Please check.
Thank you in advance.
Pull Request state was updated. Re-review required.
) { | ||
$this->getCartForUser = $getCartForUser; | ||
$this->cartRepository = $cartRepository; | ||
$this->customerCartResolver = $customerCartResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andrewbess can you check for null, for the new params here. We can have issues during the upgrade if not. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @prabhuram93
Thank you for your note.
I have fixed it.
Please check.
Thank you in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
Hi @andrewbess, thank you for your contribution! |
Description (*)
This PR makes the attribute
destination_cart_id
for mergeCarts mutation not required.Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Scenario 1.
createEmptyCart
(keep the cart ID);destination_cart_id
)Scenario 2.
customerCart
query;createEmptyCart
(keep the cart ID);destination_cart_id
)Questions or comments
Contribution checklist (*)