From 282b09b430ef06972e7adcaa4724e8041699c849 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Thu, 24 Oct 2019 10:31:30 -0500 Subject: [PATCH] magento/graphql-ce#920: [Wishlist] Remove name from WishlistOutput --- .../Model/Resolver/CustomerWishlistsResolver.php | 8 ++++---- app/code/Magento/WishlistGraphQl/etc/schema.graphqls | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistsResolver.php b/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistsResolver.php index 3556eefe36a9c..804814c424810 100644 --- a/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistsResolver.php +++ b/app/code/Magento/WishlistGraphQl/Model/Resolver/CustomerWishlistsResolver.php @@ -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; } /** @@ -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; diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index 6a833efd7c2a5..1009b6f803d93 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -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") } @@ -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") -} \ No newline at end of file +}