Skip to content

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

Open
@pmzandbergen

Description

@pmzandbergen

Preconditions and environment

912743c#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.
  • 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

Labels

Area: CatalogComponent: GraphQLGraphQLIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: PR in progressReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions