magento/magento2#40178: Fixed unnecessarily escaped characters in Gra…#40423
Conversation
|
Hi @yaroslav-kozar. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
@magento run all tests |
…uct name field - Removed ProductName resolver that was escaping product names using escapeUrl() - Restored default behavior where GraphQL returns raw product names from database - Removed ProductNameWithSpecialCharactersTest that tested incorrect escaping behavior - This fix resolves breaking changes for native apps and ensures consistency with REST API - Product names with special characters (>, <, ™, ©, etc.) now returned unescaped as expected
nuzil
left a comment
There was a problem hiding this comment.
Hey @yaroslav-kozar
I'm tended to approve this PR. Your changes makes more sense than trying to keep a resolver that escapes/unescapes things.
|
@magento run all tests |
|
Hi @yaroslav-kozar, Thanks for the collaboration & contribution! ✔️ QA PassedPreconditions:
Steps to reproduce
Before: ✖️
After: ✔️
Builds are failed. Hence, moving this PR to Extended Testing. Thanks |
|
@magento run all tests |
|
@magento run Functional Tests EE, Functional Tests CE, Functional Tests B2B |
825834a
into
magento:2.4-develop










Description (*)
This PR fixes the issue where GraphQL product name field was unnecessarily escaping special characters using
escapeUrl(), which caused breaking changes for native mobile apps and inconsistency with REST API behavior.Changes made:
ProductNameresolver that was escaping product names usingescapeUrl()ProductNameWithSpecialCharactersTestthat tested the incorrect escaping behaviorRelated Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Create a product with special characters in the name:
simple>1Simple Product 1 > < & test ♥ ™Query the product using GraphQL:
{ products(filter: { sku: { eq: "simple>1" } }) { items { sku name } } }Verify the response returns the product name without URL encoding:
{ "data": { "products": { "items": [ { "sku": "simple>1", "name": "Simple Product 1 > < & test ♥ ™" } ] } } }Compare the result with REST API response (/rest/V1/products/simple>1) - both should return identical unescaped names
Verify that product names display correctly in native mobile applications consuming the GraphQL API
Questions or comments
This change reverts the behavior introduced in a previous update that was causing breaking changes for applications relying on raw product names from GraphQL. The escaping was not only unnecessary but also inconsistent with REST API behavior and Magento's standard data handling.
Contribution checklist (*)