Skip to content

Commit e1be8f3

Browse files
authored
Merge pull request #389 from dani97/b2b-cart-address-order-req-list-pagination
pagination to support entities in b2b
2 parents 18f0536 + e454a7d commit e1be8f3

File tree

4 files changed

+53
-5
lines changed

4 files changed

+53
-5
lines changed

design-documents/graph-ql/coverage/cart/Cart.graphqls

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ type CartQueryOutput {
1313
type Cart {
1414
id: ID! @doc(description: "The ID of the cart.") @deprecated(reason: "use uid")
1515
uid: ID! @doc(description: "The unique ID of the cart.")
16-
items: [CartItemInterface]
16+
items: [CartItemInterface] @deprecated(reason: "The `items` field is deprecated. Use `items_v2` instead.")
17+
items_v2(
18+
currentPage: Int = 1 @doc(description: "current page of the customer cart items. default is 1")
19+
pageSize: Int = 20 @doc(description: "page size for the customer cart items. default is 20")
20+
): CartItems! @doc(description: "Cart items")
1721
applied_coupons: [AppliedCoupon] @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code. By default Magento supports only one coupon.")
1822
email: String
1923
shipping_addresses: [ShippingCartAddress]!
@@ -25,6 +29,12 @@ type Cart {
2529
is_virtual: Boolean!
2630
}
2731

32+
type CartItems {
33+
items: [CartItemInterface]! @doc(description: "Cart items list")
34+
page_info: SearchResultPageInfo
35+
total_count: Int!
36+
}
37+
2838
type AvailablePaymentMethod {
2939
code: String! @doc(description: "The payment method code")
3040
title: String! @doc(description: "The payment method title.")
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
type Customer {
3+
addresses: CustomerAddresses @deprecated(reason: "The `address` field is deprecated. Use `addresses_v2` instead.")
4+
addresses_v2(
5+
currentPage: Int = 1 @doc(description: "current page of the customer address list. default is 1")
6+
pageSize: Int = 10 @doc(description: "page size for the customer address list. default is 10")
7+
): CustomerAddresses!
8+
}
9+
10+
type CustomerAddresses {
11+
items: [CustomerAddress]! @doc(description: "List of customer address")
12+
page_info: SearchResultPageInfo
13+
total_count: Int!
14+
}

design-documents/graph-ql/coverage/customer/Wishlist.graphqls

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ type Customer {
1414

1515
type Wishlist {
1616
id: ID
17-
items: [WishlistItem] @deprecated(reason: "Use field `items_v2` from type `Wishlist` instead")
18-
items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist")
17+
items: [WishlistItem] @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead")
18+
items_v2: [WishlistItemInterface] @doc(description: "An array of items in the customer's wishlist") @deprecated(reason: "Use field `items_v3` from type `Wishlist` instead")
19+
items_v3(
20+
currentPage: Int = 1 @doc(description: "current page of the customer wishlist items. default is 1")
21+
pageSize: Int = 20 @doc(description: "page size for the customer wishlist items. default is 20")
22+
): WishlistItems! @doc(description: "An array of items in the customer's wishlist")
1923
items_count: Int
2024
sharing_code: String
2125
updated_at: String
2226
name: String @doc(description: "Avaialble in Commerce edition only")
2327
}
2428

29+
type WishlistItems {
30+
items: [WishlistItemInterface]!
31+
page_info: SearchResultPageInfo
32+
total_count: Int!
33+
}
34+
2535
input WishlistItemUpdateInput {
2636
wishlist_item_id: ID
2737
quantity: Float
@@ -87,4 +97,3 @@ type GiftCardWishlistItem implements WishlistItemInterface {
8797
amount: SelectedGiftCardAmount
8898
message: String
8999
}
90-

design-documents/graph-ql/coverage/customer/customer-orders.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ type CustomerOrder {
6767
order_date: String! @doc("date when the order was placed")
6868
status: String! @doc("current status of the order")
6969
number: String! @doc("sequential order number")
70-
items: [OrderItemInterface] @doc("collection of all the items purchased")
70+
items: [OrderItemInterface] @doc("collection of all the items purchased") @deprecated("The `items` field is derecated. Use `items_v2` instead.")
71+
items_v2(
72+
currentPage: Int = 1 @doc("current page of the customer order item list. default is 1")
73+
pageSize: Int = 20 @doc("page size for the customer orders item list. default is 20")
74+
): OrderItems! @doc("Collection of all of the purchased items")
7175
total: OrderTotal @doc("total amount details for the order")
7276
invoices: [Invoice] @doc("invoice list for the order")
7377
credit_memos: [CreditMemo] @doc("credit memo list for the order")
@@ -86,6 +90,17 @@ The `id` will be a `base64_encode(increment_id)` which in future can be replaced
8690
> The order `status` should be filtered in the same way as for Luma via `Order Status` and `Visible On Storefront` configuration
8791

8892
### Order Item
93+
The order items will be presented as separate interface which will have multiple implementations for invoice, shipment and credit memo types.
94+
The order items will be paginated.
95+
96+
```graphql
97+
@doc("Grpahql Order Item Output Wrapper")
98+
type OrderItems {
99+
items: [OrderItem]! @doc("List of orders items")
100+
page_info: SearchResultPageInfo
101+
total_count: Int!
102+
}
103+
```
89104

90105
```graphql
91106
interface OrderItemInterface @doc("Order item details") {

0 commit comments

Comments
 (0)