MDVA-41305: Error on GraphQL Query addProductsToWishlist for Configurable Products

The MDVA-41305 patch solves the issue where users get an error on GraphQL query addProductsToWishlist for configurable products. This patch is available when the Quality Patches Tool (QPT) 1.1.10 is installed. The patch ID is MDVA-41305. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.5.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.2

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.2 - 2.4.3-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 QPT landing page. Use the patch ID as a search keyword to locate the patch.

Issue

When users add configurable products (with/without configuration) to the Wishlist by GraphQL, they are unable to get configurable SKUs and configurable options in response.

Steps to reproduce:

  1. Create a configurable product (with Blue, Grey, and one custom option).

  2. Open frontend; log in as a customer and create a Wishlist (check wishlist_id).

  3. Open postman and create a customer token:

     
     mutation {
       generateCustomerToken(email: "", password: "") {
         token
       }
      }
      
      
  4. Set this token for Bearer Authorization.

  5. Try to add a configurable product Blue to the wishlist using the following instructions:


mutation {
 addProductsToWishlist(
   wishlistId: 1
   wishlistItems: [
     {
       sku: "conf2"
       selected_options: [
            "Y29uZmlndXJhYmxlLzkzLzUw"
       ]
       quantity: 1
       entered_options: [
         {
           uid: "Y3VzdG9tLW9wdGlvbi8x"
           value: "test"
         }
       ]
     }
    ]
  ) {
    wishlist {
      id
      items_count
      items_v2 (currentPage: 1, pageSize: 8 ) {
        items {
         id
         quantity
         ... on ConfigurableWishlistItem  {
           child_sku
           customizable_options {
             customizable_option_uid
           }
         }
         product {
           uid
           name
           sku
           options_container
           ... on CustomizableProductInterface {
             options {
              title
              required
              sort_order
              option_id
              ... on CustomizableFieldOption {
                value {
                  uid
                  sku
                  price
                  price_type
                  max_characters
                }
              }
            }
          }
          price_range {
            minimum_price {
              regular_price {
                currency
                value
              }
            }
            maximum_price {
               regular_price {
                 currency
                 value
               }
             }
           }
         }
       }
     }
   }
  user_errors {
    code
    message
   }
 }
}

Expected results:

Users can see a set of configured product options in the response specified in the payload and added to the wishlist.

Actual results:

Users get an Internal Server Error in response.

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, refer to Patches available in QPT in our developer documentation.

On this page