ACSD-52921: Error requesting cart details from GraphQL for out-of-stock configurable product

The ACSD-52921 patch fixes the issue where an internal error occurs on requesting cart details from GraphQL for an out-of-stock configurable product. This patch is available when the Quality Patches Tool (QPT) 1.1.35 is installed. The patch ID is ACSD-52921. Please note that the issue was fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.6-p1

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.5 - 2.4.6-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 Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

An internal error occurs on requesting cart details from GraphQL for an out-of-stock configurable product.

Steps to reproduce:

  1. Create a configurable product with a few options.

  2. Add an option for the above configurable product to the cart from the frontend (guest checkout).

  3. Get the [ masked_id ] from the [ quote_id_mask ] db table for the above created quote.

  4. Execute the following GraphQL query to get the above guest cart details.

    Add the [ masked_id ] received from step 3 in the query.

    code language-graphql
    {
        cart(cart_id: "masked_id") {
            items {
                product {
                    name
                    sku
                }
                ... on ConfigurableCartItem {
                    configurable_options {
                        configurable_product_option_uid
                        option_label
                        configurable_product_option_value_uid
                        value_label
                    }
                }
                quantity
                errors {
                    code
                    message
                }
            }
        }
    }
    
  5. This will return the quote details without any issues.

  6. Go to the backend and update the configurable product’s Stock Status to Out of Stock.

  7. Execute the same GraphQL query, as done in step 4.

Expected results:

The error message is sent/treated correctly in the response.

Actual results:

500 Internal Server error is thrown in response to the GraphQL query.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3