magento / catalog-storefront

Open Software License 3.0
7 stars 18 forks source link

Handle missed GQL fields for linked products #251

Open le0n4ik opened 4 years ago

le0n4ik commented 4 years ago

Overridden by "Deprecated resolver" fields should be covered by Storefront API. And depreciation logic should be removed Fields:

related_products
upsell_products
crosssell_products

GQL scheme:

interface ProductInterface {
    related_products: [ProductInterface] @doc(description: "Related Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\RelatedProducts")
    upsell_products: [ProductInterface] @doc(description: "Upsell Products")  @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\UpSellProducts")
    crosssell_products: [ProductInterface] @doc(description: "Crosssell Products") @resolver(class: "Magento\\RelatedProductGraphQl\\Model\\Resolver\\Batch\\CrossSellProducts")
}

Overridden in: app/code/Magento/CatalogStorefrontGraphQl/etc/di.xml

<preference for="Magento\RelatedProductGraphQl\Model\Resolver\Batch\RelatedProducts" type="Magento\CatalogStorefrontGraphQl\Resolver\Deprecated\RelatedProducts\RelatedProducts"/>
<preference for="Magento\RelatedProductGraphQl\Model\Resolver\Batch\CrossSellProducts" type="Magento\CatalogStorefrontGraphQl\Resolver\Deprecated\RelatedProducts\CrossSellProducts"/>
<preference for="Magento\RelatedProductGraphQl\Model\Resolver\Batch\UpSellProducts" type="Magento\CatalogStorefrontGraphQl\Resolver\Deprecated\RelatedProducts\UpSellProducts"/>

app/code/Magento/TargetRuleStorefrontGraphQl/etc/di.xml

<preference for="Magento\TargetRuleGraphQl\Model\Resolver\Batch\TargetRuleProducts" type="Magento\TargetRuleStorefrontGraphQl\Resolver\Deprecated\TargetRuleProducts"/>
m2-assistant[bot] commented 4 years ago

Hi @le0n4ik. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this