Skip to content

Commit

Permalink
[Wishlist] Remove name from WishlistOutput #920
Browse files Browse the repository at this point in the history
  • Loading branch information
XxXgeoXxX committed Oct 18, 2019
1 parent b52fe3e commit 0977e94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,16 @@ public function resolve(
array $value = null,
array $args = null
) {
$customerId = $context->getUserId();

/* Guest checking */
if (!$customerId && 0 === $customerId) {
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist'));
}
$collection = $this->_wishlistCollectionFactory->create()->filterByCustomerId($customerId);
$wishlists = $collection->getItems();
$collection = $this->_wishlistCollectionFactory->create()->filterByCustomerId($context->getUserId());
$wishlistsData = [];
if (0 === count($wishlists)) {
if (0 === $collection->getSize()) {
return $wishlistsData;
}
$wishlists = $collection->getItems();

foreach ($wishlists as $wishlist) {
$wishlistsData [] = [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/WishlistGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Customer {
}

type WishlistOutput @doc(description: "Deprecated: 'Wishlist' type should be used instead") {
items: [WishlistItem] @deprecated(reason: "Use field `items` from type `Wishlist` instead") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "An array of items in the customer's wish list"),
items: [WishlistItem] @deprecated(reason: "Use field `items` from type `Wishlist` instead") @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "An array of items in the customer's wish list"),
items_count: Int @deprecated(reason: "Use field `items_count` from type `Wishlist` instead") @doc(description: "The number of items in the wish list"),
name: String @deprecated(reason: "This field is related to Commerce functionality and is always null in Open source edition") @doc(description: "When multiple wish lists are enabled, the name the customer assigns to the wishlist"),
sharing_code: String @deprecated(reason: "Use field `sharing_code` from type `Wishlist` instead") @doc(description: "An encrypted code that Magento uses to link to the wish list"),
Expand Down

0 comments on commit 0977e94

Please sign in to comment.