-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field translator removed from \Magento\CatalogGraphQl\Model\Resolver\Product\ProductFieldsSelector #39277
Comments
Hi @pmzandbergen. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hello @pmzandbergen, Thank you for the report and collaboration! We tried to verify this on 2.4-develop, but the issue is not reproducible. Please let us know if we are missing anything. Thank you. |
Did you include the created aliasField in the GraphQL query? If so, it will be available since the underlying collection will include this field. You could update the included test by:
PS Regarding |
A patch for this issue: --- Model/Resolver/Product/ProductFieldsSelector.php.org 2024-10-21 09:28:29
+++ Model/Resolver/Product/ProductFieldsSelector.php 2024-10-21 09:30:10
@@ -52,8 +52,10 @@
if ($node->name->value !== $productNodeName) {
continue;
}
- $queryFields = $this->attributesJoiner->getQueryFields($node, $info);
- $fieldNames[] = $queryFields;
+ $queryFields = array_map(function (string $fieldName): string {
+ return $this->fieldTranslator->translate($fieldName);
+ }, $this->attributesJoiner->getQueryFields($node, $info));
+ $fieldNames[] = $queryFields;
}
return array_merge(...$fieldNames); |
Hi @engcom-Hotel. Thank you for working on this issue.
|
@engcom-November both queries in your example are using
|
Hello @pmzandbergen, Thanks for the further inputs! We have tried to reproduce the issue with Hence confirming the issue. Thanks |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-13308 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
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
regularField
.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
The text was updated successfully, but these errors were encountered: