Skip to content

Commit

Permalink
[Wishlist] Remove name from WishlistOutput #920
Browse files Browse the repository at this point in the history
  • Loading branch information
XxXgeoXxX committed Sep 27, 2019
1 parent c92ecf8 commit 4c85d84
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/code/Magento/WishlistGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,37 @@ public function testGetCustomerWishlists(): void
$this->assertEquals('simple', $response['customer']['wishlists'][0]['items'][0]['product']['sku']);
}

public function testCustomerWithoutWishlists(): void
{
$query =
<<<QUERY
{
customer
{
wishlists {
items_count
sharing_code
updated_at
items {
product {
sku
}
}
}
}
}
QUERY;

$response = $this->graphQlQuery(
$query,
[],
'',
$this->getCustomerAuthHeaders('customer@example.com', 'password')
);

$this->assertEquals([], $response['customer']['wishlists']);
}

/**
* @expectedException \Exception
* @expectedExceptionMessage The current customer isn't authorized.
Expand Down

0 comments on commit 4c85d84

Please sign in to comment.