Skip to content

Commit

Permalink
magento graphql-ce#920: Remove name from WishlistOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
lenaorobei committed Oct 29, 2019
1 parent acbc881 commit 6b443b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;

/**
* Fetches the Wishlists data according to the GraphQL schema
* Fetches customer wishlist data
*/
class CustomerWishlistResolver implements ResolverInterface
{
Expand All @@ -41,7 +41,6 @@ public function resolve(
array $value = null,
array $args = null
) {
/* Guest checking */
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,19 @@ public function testCustomerWishlist(): void
$query =
<<<QUERY
{
customer
{
wishlist {
id
items_count
sharing_code
updated_at
items {
product {
sku
customer {
wishlist {
id
items_count
sharing_code
updated_at
items {
product {
sku
}
}
}
}
}
}
}
QUERY;

Expand All @@ -82,12 +81,11 @@ public function testCustomerAlwaysHasWishlist(): void
$query =
<<<QUERY
{
customer
{
wishlist {
id
customer {
wishlist {
id
}
}
}
}
QUERY;

Expand All @@ -105,18 +103,17 @@ public function testCustomerAlwaysHasWishlist(): void
* @expectedException \Exception
* @expectedExceptionMessage The current customer isn't authorized.
*/
public function testGetGuestWishlist()
public function testGuestCannotGetWishlist()
{
$query =
<<<QUERY
{
customer
{
wishlists {
items_count
sharing_code
updated_at
}
customer {
wishlist {
items_count
sharing_code
updated_at
}
}
}
QUERY;
Expand Down

0 comments on commit 6b443b4

Please sign in to comment.