magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Field translator removed from \Magento\CatalogGraphQl\Model\Resolver\Product\ProductFieldsSelector

Open pmzandbergen opened this issue 4 months ago • 1 comments

Preconditions and environment

https://github.com/magento/magento2/commit/912743cb90ad4859b03ec648524ef99e61bb7e56#diff-fecea45cc156bda365fb84d0ac56ecf5689d01847ccb6651d4ae53d2a12e7576R58

This commit removes the field translation, used by the Product (not Products!) resolver (\Magento\CatalogGraphQl\Model\Resolver\Product). This breaks fields depending on other attributes, while they work correctly when using the Products (\Magento\CatalogGraphQl\Model\Resolver\Products) resolver.

Steps to reproduce

  1. Create an attribute depending on another attribute:
    <type name="Magento\Framework\GraphQl\Query\FieldTranslator">
        <arguments>
            <argument name="translationMap" xsi:type="array">
                <item name="aliasField" xsi:type="string">regularField</item>
            </argument>
        </arguments>
    </type>
  1. Create a product with a value for regularField.
  2. Test a query using both the Product and Products resolver for the aliasField

Expected result

Both resolvers should return the same result.

Actual result

Only the Products resolver works as expected.

Additional information

There are more GraphQL bugs regarding product resolving, for example the data could be incomplete if the product is queried as part of the CartItemInterface.

I'm trying to bundle these bugs in a MR (when I've got some spare time).

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.
  • [X] 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”.

pmzandbergen avatar Oct 17 '24 15:10 pmzandbergen