Skip to content
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

[PWA-1016] Refactor Add To Cart to use generic AddProductsToCart mutation #3092

Merged
merged 5 commits into from
Mar 31, 2021

Conversation

tjwiebell
Copy link
Contributor

Description

In Magento 2.4.1 there is a new AddProductsToCart mutation which is more generic and type agnostic than the older, type specific mutations such as "AddConfigurableProductsToCart".

  1. Investigate whether we can replace the Simple and Configurable add mutations with the generic one. If so, please do the work as part of this ticket.

  2. Investigate whether it can support future types such as Bundled/Virtual/etc. If so, we don't need the "Supported Product Types" logic anymore, so please remove that too.

Links:

https://i.gyazo.com/5e19a2e43a1b46654d053197a280c1ca.png
#2769 (comment)
https://github.com/magento/pwa-studio/blob/develop/packages/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js#L237-L262

Related Issue

  • [PWA-1016] Refactor Add To Cart to use generic AddProductsToCart mutation

Acceptance

Verification Stakeholders

Specification

Verification Steps

  1. Verify guest shoppers can add simple and configurable products to their cart
  2. Verify logged in shoppers can add simple and configurable products to their cart

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

- Deprecate old mutations and methods using product specific mutations
@tjwiebell tjwiebell added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Mar 29, 2021
@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Mar 29, 2021

Messages
📖

Associated JIRA tickets: PWA-1016.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Generated by 🚫 dangerJS against a96afe3

sirugh
sirugh previously approved these changes Mar 29, 2021
Copy link
Contributor

@sirugh sirugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with the implementation allowing for backwards compat. I think we could even reuse this pattern where we've got un-migrated gql files.

Hopefully we actually get around to removing the deprecated code.

Approving though it seems there are tests to update and a node failure.

@dpatil-magento
Copy link
Contributor

QA Approved.

@dpatil-magento dpatil-magento merged commit 40247e2 into develop Mar 31, 2021
@dpatil-magento dpatil-magento deleted the tommy/generic-atc-mutation branch March 31, 2021 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine pkg:venia-ui Progress: done version: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants