ACSD-60326: GraphQL query on customer Returns status gives an error

The ACSD-60326 patch fixes the issue where an error occurs in the GraphQL query for customer Returns status. This patch is available when the Quality Patches Tool (QPT) 1.1.51 is installed. The patch ID is ACSD-60326. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.8.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.6-p2

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.4 - 2.4.7-p2
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

GraphQL query on customer Returns status gives an error.

Steps to reproduce:

  1. Initialize a fresh instance with sample data.

  2. On the Admin sidebar, go to Stores > Settings > Configuration > Sales > RMA Settings and set Enable RMA on Storefront to Yes.

  3. Go to Sales > Shipping Settings > Origin and fill out the address.

  4. Change the password for the customer roni_cost@example.com.

  5. Log in to the admin panel and place an order for the customer roni_cost@example.com with the following products:

    • WSH12-32-Red
    • WSH12-32-Purple
    • WSH12-32-Green
  6. Create an Invoice and Shipment for this order.

  7. Select Create Returns.

  8. Go to Return Items > Add Items and:

    • Select WSH12-32-Red and WSH12-32-Purple

    • Click Add Selected Products to returns:

      • Set Requested = 1
      • Set Return Reason to Out of Service
      • Set Item Condition to Opened
      • Set Resolution to Refund
    • Click Submit Returns.

  9. Open Returns and select Return Items on the left.

    • Set Authorized = 1 for both the products
    • Set Status as Authorized for WSH12-32-Purple
    • Set Status as Denied for WSH12-32-Red
    • Click Save
  10. Create a new order with the same products.

  11. Create an Invoice, Shipment, and Returns for the same products. Authorize both and proceed until the end of the Returns process.

  12. Generate a customer token using the following GraphQL query:

    code language-graphql
     mutation {
      generateCustomerToken(email: "roni_cost@example.com", password: "password") {
        token
       }
    }
    
  13. Authorize with the received token and perform following query:

    code language-none
    {
    customer {
        returns(pageSize: 20, currentPage: 1) {
         total_count
            items {
                uid
                number
                status
                created_at
            }
        }
    }
    }
    

Expected results:

The query does not show any error. The status of the second return is not null.

Actual results:

The query returns an internal server error:

    {
    "errors": [
        {
            "message": "Internal server error",
            "locations": [
                {
                    "line": 8,
                    "column": 5
                }
            ],
            "path": [
                "customer",
                "returns",
                "items",
                1,
                "status"
            ]
        }
    ],
    "data": {
        "customer": {
            "returns": {
                "total_count": 2,
                "items": [
                    {
                        "uid": "MQ==",
                        "number": "000000001",
                        "status": "PARTIALLY_AUTHORIZED",
                        "created_at": "2024-07-09 10:35:55"
                    },
                    {
                        "uid": "Mg==",
                        "number": "000000002",
                        "status": null,
                        "created_at": "2024-07-09 10:50:02"
                    }
                ]
            }
        }
    }
    }

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 Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

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