Skip to content

Commit 6b443b4

Browse files
committed
magento graphql-ce#920: Remove name from WishlistOutput
1 parent acbc881 commit 6b443b4

File tree

2 files changed

+23
-27
lines changed

2 files changed

+23
-27
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1515

1616
/**
17-
* Fetches the Wishlists data according to the GraphQL schema
17+
* Fetches customer wishlist data
1818
*/
1919
class CustomerWishlistResolver implements ResolverInterface
2020
{
@@ -41,7 +41,6 @@ public function resolve(
4141
array $value = null,
4242
array $args = null
4343
) {
44-
/* Guest checking */
4544
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
4645
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
4746
}

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

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,19 @@ public function testCustomerWishlist(): void
4444
$query =
4545
<<<QUERY
4646
{
47-
customer
48-
{
49-
wishlist {
50-
id
51-
items_count
52-
sharing_code
53-
updated_at
54-
items {
55-
product {
56-
sku
47+
customer {
48+
wishlist {
49+
id
50+
items_count
51+
sharing_code
52+
updated_at
53+
items {
54+
product {
55+
sku
56+
}
57+
}
5758
}
58-
}
5959
}
60-
}
6160
}
6261
QUERY;
6362

@@ -82,12 +81,11 @@ public function testCustomerAlwaysHasWishlist(): void
8281
$query =
8382
<<<QUERY
8483
{
85-
customer
86-
{
87-
wishlist {
88-
id
84+
customer {
85+
wishlist {
86+
id
87+
}
8988
}
90-
}
9189
}
9290
QUERY;
9391

@@ -105,18 +103,17 @@ public function testCustomerAlwaysHasWishlist(): void
105103
* @expectedException \Exception
106104
* @expectedExceptionMessage The current customer isn't authorized.
107105
*/
108-
public function testGetGuestWishlist()
106+
public function testGuestCannotGetWishlist()
109107
{
110108
$query =
111109
<<<QUERY
112110
{
113-
customer
114-
{
115-
wishlists {
116-
items_count
117-
sharing_code
118-
updated_at
119-
}
111+
customer {
112+
wishlist {
113+
items_count
114+
sharing_code
115+
updated_at
116+
}
120117
}
121118
}
122119
QUERY;

0 commit comments

Comments
 (0)