diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php similarity index 97% rename from app/code/Magento/CatalogGraphQl/Model/Resolver/Category.php rename to app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php index 7a4bd098f0129..378e7cb4c3673 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Category.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php @@ -20,9 +20,9 @@ use Magento\Framework\Reflection\DataObjectProcessor; /** - * Resolver for categoriy objects the product is assigned to. + * Resolver for category objects the product is assigned to. */ -class Category implements ResolverInterface +class Categories implements ResolverInterface { /** * @var Collection diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/FilterArgument/ProductEntityAttributesForAst.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/FilterArgument/ProductEntityAttributesForAst.php index c09b23e90d44e..a547f63b217fe 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/FilterArgument/ProductEntityAttributesForAst.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/FilterArgument/ProductEntityAttributesForAst.php @@ -25,7 +25,7 @@ class ProductEntityAttributesForAst implements FieldEntityAttributesInterface /** * @var array */ - private $additionalAttributes; + private $additionalAttributes = ['min_price', 'max_price', 'category_id']; /** * @param ConfigInterface $config @@ -33,10 +33,10 @@ class ProductEntityAttributesForAst implements FieldEntityAttributesInterface */ public function __construct( ConfigInterface $config, - array $additionalAttributes = ['min_price', 'max_price', 'category_id'] + array $additionalAttributes = [] ) { $this->config = $config; - $this->additionalAttributes = $additionalAttributes; + $this->additionalAttributes = array_merge($this->additionalAttributes, $additionalAttributes); } /** diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 7c89e308cac8a..762861de94e67 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -278,7 +278,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\ price: ProductPrices @doc(description: "A ProductPrices object, indicating the price of an item") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\Price") gift_message_available: String @doc(description: "Indicates whether a gift message is available") manufacturer: Int @doc(description: "A number representing the product's manufacturer") - categories: [CategoryInterface] @doc(description: "The categories assigned to a product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category") + categories: [CategoryInterface] @doc(description: "The categories assigned to a product") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Categories") canonical_url: String @doc(description: "Canonical URL") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CanonicalUrl") }