Open pmzandbergen opened 1 month ago
Hi @pmzandbergen. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.
@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hello @pmzandbergen,
Thank you for the report and collaboration!
We tried to verify this on 2.4-develop, but the issue is not reproducible. Added regularField and aliasField and made it dependent, but we are getting the same response with product and products query. Here is the module used to reproduce this issue. I39277V.zip
Please let us know if we are missing anything.
Thank you.
Hello @pmzandbergen,
Thank you for the report and collaboration!
We tried to verify this on 2.4-develop, but the issue is not reproducible. Added regularField and aliasField and made it dependent, but we are getting the same response with product and products query. Here is the module used to reproduce this issue. I39277V.zip
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:
aliasField
, do not query both fieldscustom_attributesV2
, as it is using a separate resolver_PS Regarding custom_attributesV2
, I don't fully understand the decision for this setup. It does not support GraphQL types and it is impossible to exactly specify the required fields._
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);
@pmzandbergen,
When querying using both product and products, I am getting null for aliasField using di.xml provided above. Please take a look at the screenshot: Product query:
{
products(filter: { sku: { eq:"test-prd-1" } } pageSize:100 ) {
items {
sku
name
alias_field
}
}
}
Products query:
{
products(filter: { } pageSize:100 ) {
items {
sku
name
alias_field
}
}
}
Can you give more insight on this.
Thank you.
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. @engcom-November both queries in your example are using \Magento\CatalogGraphQl\Model\Resolver\Products
. Usage of the affected resolver \Magento\CatalogGraphQl\Model\Resolver\Product
can be found in the following interfaces / types:
ConfigurableCartItem
(field configured_variant
)OrderItemInterface
(field product
)WishlistItemInterface
(field product
)Hello @pmzandbergen,
Thanks for the further inputs!
We have tried to reproduce the issue with ConfigurableCartItem (field configured_variant)
and the issue is reproducible for us.
Hence confirming the issue.
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13308 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
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
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