Closed AAMANATHULLAH closed 1 year ago
@LSantha can you have a look
@AAMANATHULLAH , in a quick test I can see the the url_key you added under categoriescustom is null in the results , while all the other properties have values for the after upgrade query. I think this is a bug in Adobe Commerce (Magento).
@LSantha We are able to fetch the url_key value from categoriescustom if the categories object is not included in OOTB query which i highlighted in the above screenshot This issue is happening as the categories object is getting included in the OOTB query by CIF product model . I highlighted the same in screenshot attached in issue
Fetching the categories of a product has been introduced with 1.8.0:
Currently it is not possible to use the query hook mechanism to extend the a nested field in the query. It seems you added a custom field selection for the categories, which is a reasonable workaround. But @LSantha is right, this is an issue in Adobe Commerce in the way it processes selections that appear multiple times in a query (with or without an alias)
E.g. using https://venia.magento.com/graphql
The query:
{
products(filter:{ sku: {eq: "VA01"}}) {
items{
sku,
categories{
name
},
categories_custom_: categories {
url_key
}
}
}
}
does not return the url_key
for categories_custom_
, but he query
{
products(filter:{ sku: {eq: "VA01"}}) {
items{
sku,
categories {
name
url_key
},
categories_custom_: categories {
url_key
}
}
}
}
does. Actually even
{
products(filter:{ sku: {eq: "VA01"}}) {
items{
sku,
categories {
name
},
categories {
url_key
}
}
}
}
would be valid. We should loop in someone from the Magento team here.
@Buuhuu @LSantha Thanks for your help Adobe Magento team has provided a patch to fix this issue and we are now able to fetch the url_key value in categories object in products query
We have upgraded CIF version from 1.7.0 to 2.12.0 and magento.graphql.version from 6.0.0-magento235 to 9.1.0-magento242ee After upgrade OOTB Products query from com.adobe.cq.commerce.core.components.models.product is including categories{__typename,uid,name,image} object due to which we are unable to get url_key attribute in categories object Attached the products query before and after the upgrade We are using url_key from categories object for custom analytics tracking We are unable to get url_key value in categories object in products query in response which we used to get earlier before upgrade. Please assist here @Buuhuu @herzog31 products_Query_After_upgrade.txt products_Query_Before_upgrade.txt