Skip to content

Commit

Permalink
magento/graphql-ce#920: [Wishlist] Remove name from WishlistOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaorobei committed Oct 24, 2019
1 parent bff6344 commit 282b09b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class CustomerWishlistsResolver implements ResolverInterface
/**
* @var CollectionFactory
*/
private $_wishlistCollectionFactory;
private $wishlistCollectionFactory;

/**
* @param CollectionFactory $wishlistCollectionFactory
*/
public function __construct(CollectionFactory $wishlistCollectionFactory)
{
$this->_wishlistCollectionFactory = $wishlistCollectionFactory;
$this->wishlistCollectionFactory = $wishlistCollectionFactory;
}

/**
Expand All @@ -43,9 +43,9 @@ public function resolve(
) {
/* Guest checking */
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist'));
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
}
$collection = $this->_wishlistCollectionFactory->create()->filterByCustomerId($context->getUserId());
$collection = $this->wishlistCollectionFactory->create()->filterByCustomerId($context->getUserId());
$wishlistsData = [];
if (0 === $collection->getSize()) {
return $wishlistsData;
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/WishlistGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ type Customer {
wishlists: [Wishlist]! @resolver(class:"\\Magento\\WishlistGraphQl\\Model\\Resolver\\CustomerWishlistsResolver") @doc(description: "The wishlist query returns the contents of a customer's wish lists") @cache(cacheable: false)
}

type WishlistOutput @doc(description: "Deprecated: 'Wishlist' type should be used instead") {
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_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"),
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"),
updated_at: String @deprecated(reason: "Use field `updated_at` from type `Wishlist` instead") @doc(description: "The time of the last modification to the wish list")
}
Expand All @@ -30,4 +30,4 @@ type WishlistItem {
description: String @doc(description: "The customer's comment about this item"),
added_at: String @doc(description: "The time when the customer added the item to the wish list"),
product: ProductInterface @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver")
}
}

0 comments on commit 282b09b

Please sign in to comment.