Skip to content

Commit

Permalink
MAGETWO-92773: [GraphQL] Products cannot be fetched in parent/anchor …
Browse files Browse the repository at this point in the history
…category #89
  • Loading branch information
Alex Paliarush committed Jun 14, 2018
1 parent 4431b56 commit 19dbdde
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ class ProductEntityAttributesForAst implements FieldEntityAttributesInterface
/**
* @var array
*/
private $additionalAttributes;
private $additionalAttributes = ['min_price', 'max_price', 'category_id'];

/**
* @param ConfigInterface $config
* @param array $additionalAttributes
*/
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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 19dbdde

Please sign in to comment.