QUALITY PATCH

MDVA-44505: The GraphQL query for a cart applying reward points does not consider the reward points…

The GraphQL query for a cart applying reward points does not consider the reward points and returns an incorrect grand total. Quality patch MDVA-44505 for magento/module-reward-graph-ql applies to Magento Open Source and Adobe Commerce 2.4.1 to 2.4.2-p2.

Categories
Web API
Components
magento/module-reward-graph-ql
Origin
adobe-commerce-support
Since QPT
1.1.14

Issue

The GraphQL query for a cart applying reward points does not consider the reward points and returns an incorrect grand total.

Steps to reproduce

1. Configure reward points. 1. Create a cart and apply some reward points. 1. Call the GetCart query from the GraphQL endpoint and retrieve your cart: query { cart(cart_id: "{CART_ID}") { prices { discounts { amount { value } } grand_total { value } } } } 1. Check the grand total entry. 1. Now check the customer's cart total using rest API (/rest/V1/carts/mine/totals).

Adobe's page lists 2.4.1 - 2.4.2-p2 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-44505. On Cloud, add MDVA-44505 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-44505/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (1): magento/module-reward-graph-ql

magento/magento2-ee-base >=2.4.1 <2.4.3

Magento Open Source
—
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2, 2.4.1-p1, 2.4.1
Requires
MDVA-40830
Patch file
patches/commerce/MDVA-44505_2.4.2.patch
  • vendor/magento/module-reward-graph-ql/Plugin/Quote/Model/Quote/TotalsCollector/ResetQuoteRewardPointsAmountPlugin.php (added)
  • vendor/magento/module-reward-graph-ql/etc/graphql/di.xml

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.