Skip to content

GraphQL addWishlistItemsToCart Mutation Fails with Date Custom Option — Internal Server Error #40013

Closed
@L1ntothomas

Description

@L1ntothomas

Preconditions and environment

When using the addWishlistItemsToCart GraphQL mutation in Magento 2.4.7-p4, an Internal Server Error occurs only when the product has a custom date option. The product is successfully added to the wishlist with the custom options (including date), but attempting to add it from the wishlist to the cart fails.

The mutation works correctly when:

The product has no custom date option.

The product has Date & Time or Time custom options.

The mutation fails only when the product includes a Date-only custom option.

Environment:

Magento Version: 2.4.7-p4

PHP Version: (e.g., 8.1)

GraphQL Endpoint: /graphql

Product Type: Simple product with customizable options

Failing Option Type: Date

Working Option Types: Time, Date & Time

Steps to reproduce

Use the following mutation to add a product with date and other custom options to a wishlist:
mutation AddToWishlist {
addProductsToWishlist(
wishlistId: "86"
wishlistItems: [
{
sku: "WJ12",
quantity: 1,
selected_options: ["Y29uZmlndXJhYmxlLzkzLzU3", "Y29uZmlndXJhYmxlLzE0NC8xNzA="],
entered_options: [
{uid: "Y3VzdG9tLW9wdGlvbi8yMg==", value: "12"},
{uid: "Y3VzdG9tLW9wdGlvbi8yMg==", value: "13"},
{uid: "Y3VzdG9tLW9wdGlvbi82Mw==", value: "2025-06-20 00:00:00"},
{uid: "Y3VzdG9tLW9wdGlvbi8yMA==", value: "31"},
{uid: "Y3VzdG9tLW9wdGlvbi8yMQ==", value: "34"}
]
}
]
) {
wishlist {
id
items_count
items {
id
product {
name
}
}
}
}
}
Then try to add the wishlist item to the cart:
mutation {
addWishlistItemsToCart(
wishlistId: 86
wishlistItemIds: [1133]
) {
status
add_wishlist_items_to_cart_user_errors {
wishlistItemId
code
message
}
wishlist {
id
items_count
items_v2 {
items {
id
product {
uid
sku
name
}
customizable_options {
label
type
customizable_option_uid
values {
value
label
price {
type
value
}
}
}
}
}
}
}
}

Expected result

The wishlist item should be successfully added to the cart, including the date and other custom options.

Actual result

The response returns:
{
"errors": [
{
"message": "Internal server error",
"locations": [
{ "line": 2, "column": 3 }
],
"path": [ "addWishlistItemsToCart" ]
}
],
"data": {
"addWishlistItemsToCart": null
}
}

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Reported on 2.4.7-p4Indicates original Magento version for the Issue report.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions