MDVA-37362: Configurable product options are empty in GraphQL response
The MDVA-37362 patch solves the issue where configurable product option values and variant attribute values are empty in the GraphQL response. This patch is available when the Quality Patches Tool (QPT) v.1.0.23 is installed. Please note that the issue is scheduled to be fixed in Adobe Commerce version 2.4.3.
Affected products and versions
- The patch was designed for Adobe Commerce on cloud infrastructure 2.4.2
- The patch is also compatible with Adobe Commerce on-premises and Adobe Commerce on cloud infrastructure 2.3.4 - 2.4.2-p1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches
package to the latest version and check the compatibility on the [!DNL Quality Patches Tool]: Search for patches page. Use the patch ID as a search keyword to locate the patch.
Issue
Steps to reproduce:
- Create a new source and a new stock assigned to this new source.
-
Stores > Settings > Configuration > Catalog > Inventory > Product Stock Options > Manage Stock: YES.
- Create a configurable product, and assign the product's quantity with the new stock that was created in step 1.
- Reindex.
- Make a GraphQL request.
- Request:
{
products(filter: { sku: { eq: "test-config-product" } }) {
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
}
}
}
}
}
}
Expected results:
Option values and attributes should be present in the response.
Actual results:
{
"data": {
"products": {
"items": [
{
"id": 2048,
"attribute_set_id": 4,
"name": "Test Configurable Product",
"sku": "test-config-product",
"__typename": "ConfigurableProduct",
"price_range": {
"minimum_price": {
"regular_price": {
"value": 100,
"currency": "USD"
}
}
},
"categories": [
{
"id": 3
}
],
"configurable_options": [
{
"id": 296,
"attribute_id_v2": 93,
"label": "Color",
"position": 1,
"use_default": false,
"attribute_code": "color",
"values": [],
"product_id": 2048
},
{
"id": 297,
"attribute_id_v2": 186,
"label": "Size",
"position": 0,
"use_default": false,
"attribute_code": "size",
"values": [],
"product_id": 2048
}
],
"variants": [
{
"product": {
"id": 2051,
"name": "Test Configurable Product-M-Black",
"sku": "test-config-product-M-Black",
"attribute_set_id": 4,
"weight": null,
"price_range": {
"minimum_price": {
"regular_price": {
"value": 100,
"currency": "USD"
}
}
}
},
"attributes": []
},
{
"product": {
"id": 2052,
"name": "Test Configurable Product-M-Blue",
"sku": "test-config-product-M-Blue",
"attribute_set_id": 4,
"weight": null,
"price_range": {
"minimum_price": {
"regular_price": {
"value": 100,
"currency": "USD"
}
}
}
},
"attributes": []
},
{
"product": {
"id": 2049,
"name": "Test Configurable Product-S-Black",
"sku": "test-config-product-S-Black",
"attribute_set_id": 4,
"weight": null,
"price_range": {
"minimum_price": {
"regular_price": {
"value": 100,
"currency": "USD"
}
}
}
},
"attributes": []
}
]
}
]
}
}
}
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
To learn more about Quality Patches Tool, refer to:
For info about other patches available in QPT tool, refer to the Patches available in QPT tool section.