Skip to content

Unable to clear wishlist item comment via updateProductsInWishlist GraphQL mutation #39911

Open
@Syamsg

Description

@Syamsg

Preconditions and environment

  1. Magento Open Source 2.4.7 (or your version)
  2. PHP 8.1 (or 8.2)
  3. Sample data installed, GraphQL module enabled
  4. A customer with at least one wishlist item that already has a non-empty description field

Steps to reproduce

  1. Authenticate as that customer and obtain a valid bearer token.
  2. Send this GraphQL mutation:

`

mutation {
  updateProductsInWishlist(
    wishlistId: "1",
    wishlistItems: [
      {
        wishlist_item_id: "1",
        quantity: 2,
        description: ""
      }
    ]
  ) {
    wishlist {
      id
      items {
        id
        description
        product { name }
      }
    }
  }
}`

### Expected result

The description (comment) on wishlist item 1 should be cleared (i.e. set to null or an empty string) in the database, and the GraphQL response should show either:

"description": null or "description": ""

### Actual result

The GraphQL response still returns the old, non-empty description.
Reviewing the database, the wishlist_item.comment column remains unchanged.

{
"data": {
 "updateProductsInWishlist": {
   "wishlist": {
     "items": [
       {
         "id": "1",
         "description": "My original comment",
         "product": {
           "name": "24-MB01"
         }
       }
     ]
   }
 }
}
}

### Additional information

_No response_

### Release note

_No response_

### Triage and priority

- [x] 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, “qualityorusability”._

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: AccountComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Reported on 2.4.7Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions