QUALITY PATCH

ACSD-45817: A GraphQL products mutation for a specific store returns all configurable variants…

A GraphQL products mutation for a specific store returns all configurable variants, including those not assigned to the requested store. Quality patch ACSD-45817 for magento/module-configurable-product applies to Magento Open Source and Adobe Commerce 2.4.2 to 2.4.3-p3.

Categories
GraphQL, Catalog/Product
Components
magento/module-configurable-product, magento/module-configurable-product-graph-ql
Origin
adobe-commerce-support
Since QPT
1.1.18

Issue

A GraphQL products mutation for a specific store returns all configurable variants, including those not assigned to the requested store.

Steps to reproduce

1. Create a configurable product with two subproducts: "configurable-a" and "configurable-b". 1. Assign the configurable product to both websites. 1. Assign only one "configurable-a" variation to the 2nd website. 1. Go to the Storefront, switch to the 2nd website, and open the configurable product. 1. Make sure you see only one child option: "configurable-a". 1. Run a GraphQL query using POST: /graphql endpoint, and Headers: "store" = "new" { products(filter: { sku: { eq: "configurable" } }) { items { id attribute_set_id name sku __typename price_range{ minimum_price{ regular_price{ value currency } } } categories { id } ... on ConfigurableProduct { configurable_options { id attribute_id_v2 label position use_default attribute_code values { value_index label } product_id } variants { product { id name sku attribute_set_id ... on PhysicalProductInterface { weight } price_range{ minimum_price{ regular_price{ value currency } } } } attributes { uid label code value_index } } } } } }

Adobe's page lists 2.4.2 - 2.4.3-p3 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 ACSD-45817. On Cloud, add ACSD-45817 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-45817/ 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 (2): magento/module-configurable-product, magento/module-configurable-product-graph-ql
Packages across compatible versions (2): magento/module-configurable-product, magento/module-configurable-product-graph-ql

magento/magento2-base >=2.4.2 <2.4.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3, 2.4.2-p2, 2.4.2-p1, 2.4.2
Patch file
patches/os/ACSD-45817_2.4.3-p1.patch
  • vendor/magento/module-configurable-product/Plugin/Model/ResourceModel/Attribute/ScopedOptionSelectBuilder.php (added)
  • vendor/magento/module-configurable-product/etc/frontend/di.xml
  • vendor/magento/module-configurable-product-graph-ql/Model/Variant/Collection.php
  • vendor/magento/module-configurable-product-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.