diff --git a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls index b7cc60fe100c6..28d80c4a21884 100644 --- a/app/code/Magento/WishlistGraphQl/etc/schema.graphqls +++ b/app/code/Magento/WishlistGraphQl/etc/schema.graphqls @@ -10,11 +10,11 @@ type Customer { } type WishlistOutput @doc(description: "Deprecated: 'Wishlist' type should be used instead") { - items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "Deprecated: use field `items` from type `Wishlist`"), - items_count: Int @doc(description: "Deprecated: use field `items_count` from type `Wishlist`"), - name: String @doc(description: "Deprecated."), - sharing_code: String @doc(description: "Deprecated: use field `sharing_code` from type `Wishlist`"), - updated_at: String @doc(description: "Deprecated: use field `updated_at` from type `Wishlist`") + 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"), + 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") } type Wishlist { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php index 2a6c70161a623..2d6c3ff34b0ab 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php @@ -73,6 +73,37 @@ public function testGetCustomerWishlists(): void $this->assertEquals('simple', $response['customer']['wishlists'][0]['items'][0]['product']['sku']); } + public function testCustomerWithoutWishlists(): void + { + $query = + <<graphQlQuery( + $query, + [], + '', + $this->getCustomerAuthHeaders('customer@example.com', 'password') + ); + + $this->assertEquals([], $response['customer']['wishlists']); + } + /** * @expectedException \Exception * @expectedExceptionMessage The current customer isn't authorized.