Skip to content

Commit 4c85d84

Browse files
committed
[Wishlist] Remove name from WishlistOutput #920
1 parent c92ecf8 commit 4c85d84

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ type Customer {
1010
}
1111

1212
type WishlistOutput @doc(description: "Deprecated: 'Wishlist' type should be used instead") {
13-
items: [WishlistItem] @resolver(class: "\\Magento\\WishlistGraphQl\\Model\\Resolver\\WishlistItemsResolver") @doc(description: "Deprecated: use field `items` from type `Wishlist`"),
14-
items_count: Int @doc(description: "Deprecated: use field `items_count` from type `Wishlist`"),
15-
name: String @doc(description: "Deprecated."),
16-
sharing_code: String @doc(description: "Deprecated: use field `sharing_code` from type `Wishlist`"),
17-
updated_at: String @doc(description: "Deprecated: use field `updated_at` from type `Wishlist`")
13+
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"),
14+
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"),
16+
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"),
17+
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
}
1919

2020
type Wishlist {

dev/tests/api-functional/testsuite/Magento/GraphQl/Wishlist/CustomerWishlistsTest.php

+31
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,37 @@ public function testGetCustomerWishlists(): void
7373
$this->assertEquals('simple', $response['customer']['wishlists'][0]['items'][0]['product']['sku']);
7474
}
7575

76+
public function testCustomerWithoutWishlists(): void
77+
{
78+
$query =
79+
<<<QUERY
80+
{
81+
customer
82+
{
83+
wishlists {
84+
items_count
85+
sharing_code
86+
updated_at
87+
items {
88+
product {
89+
sku
90+
}
91+
}
92+
}
93+
}
94+
}
95+
QUERY;
96+
97+
$response = $this->graphQlQuery(
98+
$query,
99+
[],
100+
'',
101+
$this->getCustomerAuthHeaders('customer@example.com', 'password')
102+
);
103+
104+
$this->assertEquals([], $response['customer']['wishlists']);
105+
}
106+
76107
/**
77108
* @expectedException \Exception
78109
* @expectedExceptionMessage The current customer isn't authorized.

0 commit comments

Comments
 (0)