Skip to content

Commit 282b09b

Browse files
committed
magento/graphql-ce#920: [Wishlist] Remove name from WishlistOutput
1 parent bff6344 commit 282b09b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistsResolver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class CustomerWishlistsResolver implements ResolverInterface
2121
/**
2222
* @var CollectionFactory
2323
*/
24-
private $_wishlistCollectionFactory;
24+
private $wishlistCollectionFactory;
2525

2626
/**
2727
* @param CollectionFactory $wishlistCollectionFactory
2828
*/
2929
public function __construct(CollectionFactory $wishlistCollectionFactory)
3030
{
31-
$this->_wishlistCollectionFactory = $wishlistCollectionFactory;
31+
$this->wishlistCollectionFactory = $wishlistCollectionFactory;
3232
}
3333

3434
/**
@@ -43,9 +43,9 @@ public function resolve(
4343
) {
4444
/* Guest checking */
4545
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
46-
throw new GraphQlAuthorizationException(__('The current user cannot perform operations on wishlist'));
46+
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
4747
}
48-
$collection = $this->_wishlistCollectionFactory->create()->filterByCustomerId($context->getUserId());
48+
$collection = $this->wishlistCollectionFactory->create()->filterByCustomerId($context->getUserId());
4949
$wishlistsData = [];
5050
if (0 === $collection->getSize()) {
5151
return $wishlistsData;

app/code/Magento/WishlistGraphQl/etc/schema.graphqls

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ type Customer {
99
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)
1010
}
1111

12-
type WishlistOutput @doc(description: "Deprecated: 'Wishlist' type should be used instead") {
12+
type WishlistOutput @doc(description: "Deprecated: `Wishlist` type should be used instead") {
1313
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"),
1414
items_count: Int @deprecated(reason: "Use field `items_count` from type `Wishlist` instead") @doc(description: "The number of items in the wish list"),
15-
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"),
15+
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"),
1616
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"),
1717
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")
1818
}
@@ -30,4 +30,4 @@ type WishlistItem {
3030
description: String @doc(description: "The customer's comment about this item"),
3131
added_at: String @doc(description: "The time when the customer added the item to the wish list"),
3232
product: ProductInterface @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\ProductResolver")
33-
}
33+
}

0 commit comments

Comments
 (0)