Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 3fbf9ca

Browse files
authored
GraphQL: Requisition list updates (#8408)
* GraphQL: Non-mutation requisition list updates * review draft * Designate topic as B2B only
1 parent 95d845b commit 3fbf9ca

File tree

5 files changed

+212
-25
lines changed

5 files changed

+212
-25
lines changed

src/_data/toc/graphql.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ pages:
183183

184184
- label: addProductsToRequisitionList mutation
185185
url: /graphql/mutations/add-products-to-requisition-list.html
186+
edition: ee-only
186187
exclude_versions: [ "2.3" ]
187188

188189
- label: addProductsToWishlist mutation
@@ -191,6 +192,7 @@ pages:
191192

192193
- label: addRequisitionListItemsToCart mutation
193194
url: /graphql/mutations/add-requisition-list-items-to-cart.html
195+
edition: ee-only
194196
exclude_versions: [ "2.3" ]
195197

196198
- label: addSimpleProductsToCart mutation
@@ -479,6 +481,7 @@ pages:
479481

480482
- label: updateRequisitionListItems mutation
481483
url: /graphql/mutations/update-requisition-list-items.html
484+
edition: ee-only
482485
exclude_versions: [ "2.3" ]
483486

484487
- label: updateWishlist mutation
@@ -533,10 +536,16 @@ pages:
533536
url: /graphql/interfaces/order-item-interface.html
534537
exclude_versions: ["2.3"]
535538

539+
- label: RequisitionListItemInterface attributes and implementations
540+
url: /graphql/interfaces/requisition-list-item-interface.html
541+
edition: b2b-only
542+
exclude_versions: ["2.3"]
543+
536544
- label: ShipmentItemInterface attributes and implementations
537545
url: /graphql/interfaces/shipment-item-interface.html
538546
exclude_versions: ["2.3"]
539547

548+
540549
- label: Payment methods
541550
children:
542551

src/_includes/graphql/customer-output-24.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@ Attribute | Data Type | Description
2121
`firstname` | String | The customer's first name
2222
`gender` | Int | The customer's gender (Male - 1, Female - 2)
2323
`group_id` | Int | Deprecated. This attribute is not applicable for GraphQL. The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer)
24-
`id` | Int | Deprecated. This attribute is not applicable for GraphQL.The ID assigned to the customer
24+
`id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer
2525
`is_subscribed` | Boolean | Indicates whether the customer is subscribed to the company's newsletter
2626
`lastname` | String | The customer's family name
2727
`middlename` |String | The customer's middle name
28-
`orders(<FilterCriteria>)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }}
28+
`orders(filter CustomerOrdersFilterInput, currentPage = 1 Int, pageSize = 20 Int)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }}
2929
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
3030
`reviews(pageSize: Int = 20 currentPage: Int = 1)` | ProductReviews! | The list of reviews of the product
3131
`reward_points` | RewardPoints | Details about the customer's reward points
3232
`suffix` | String | A value such as Sr., Jr., or III
3333
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
34-
`wishlist` | Wishlist! | Contains the contents of the customer's wish lists
34+
`wishlist` | Wishlist! | Deprecated. Use `wishlist_v2` instead. Contains the contents of the customer's wish lists
35+
`wishlist_v2(id ID!)` | Wishlist | Retrieve the specified wish list identified by the unique ID for a Wishlist object
3536

36-
For B2B, company users can have the following attributes.
37+
For B2B, company administrators and users can have the following attributes.
3738

3839
Attribute | Data Type | Description
3940
--- | --- | ---
4041
`job_title` | String | The job title for a B2B company user
42+
`requisition_lists (pageSize = 20 Int, currentPage = 1 Int, filter RequisitionListFilterInput)` | RequisitionLists | Contains the customer's requisition lists
4143
`role`| CompanyRole | The role name and permissions assigned to the company user
4244
`status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE
4345
`team` | CompanyTeam | The team the company user is assigned to

src/_includes/graphql/requisition-list.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ The `RequisitionList` object contains the following attributes.
33
Attribute | Data Type | Description
44
--- | --- | ---
55
`description` | String | Optional text that describes the requisition list
6-
`items` | RequistionListItems | An array of products added to the requisition list
6+
`items` | [RequistionListItems](#RequistionListItems) | An array of products added to the requisition list
77
`items_count` | Int! | The number of items in the list
88
`name` | String! | The requisition list name
99
`uid` | ID! | The unique requisition list ID
1010
`updated_at` | String | The time of the last modification of the requisition list
11+
12+
### RequistionListItems attributes {#RequistionListItems}
13+
14+
The `RequistionListItems` object contains the following attributes.
15+
16+
Attribute | Data Type | Description
17+
--- | --- | ---
18+
`items` | [RequisitionListItemInterface]! | An array of items in the requisition list
19+
`page_info` | SearchResultPageInfo | Contains pagination metadata
20+
`total_pages` | Int! | The number of pages returned
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
---
2+
group: graphql
3+
title: RequisitionListItemInterface attributes and implementations
4+
---
5+
6+
`RequisitionListItemInterface` provides details about items in a requisition list. It has the following implementations:
7+
8+
* [`BundleRequisitionListItem`](#BundleRequisitionListItem)
9+
* [`ConfigurableRequisitionListItem`](#ConfigurableRequisitionListItem)
10+
* [`DownloadableRequisitionListItem`](#DownloadableRequisitionListItem)
11+
* [`GiftCardRequisitionListItem`](#GiftCardRequisitionListItem)
12+
* [`SimpleRequisitionListItem`](#SimpleRequisitionListItem)
13+
* [`VirtualRequisitionListItem`](#VirtualRequisitionListItem)
14+
15+
{:.bs-callout-info}
16+
There is not an implementation for grouped products. The items within a grouped product are managed individually.
17+
18+
## Attributes
19+
20+
The `RequisitionListItemInterface` defines the following attributes.
21+
22+
Attribute | Data Type | Description
23+
--- | --- | ---
24+
`customizable_options`: [SelectedCustomizableOption] | Selected custom options for an item in the requisition list
25+
`product` | [ProductInterface!]({{page.baseurl}}/graphql/interfaces/product-interface.html) | Contains details about an item added to a requisition list
26+
`quantity` | Float! | The amount added
27+
`uid` | ID! | The unique ID for the requisition list item
28+
29+
## Implementations
30+
31+
### BundleRequisitionListItem attributes {#BundleRequisitionListItem}
32+
33+
The `BundleRequisitionListItem` implementation adds the following attribute.
34+
35+
Attribute | Data Type | Description
36+
--- | --- | ---
37+
`bundle_options`| [SelectedBundleOption]! | An array of selected options for a bundle product
38+
39+
### ConfigurableRequisitionListItem attributes {#ConfigurableRequisitionListItem}
40+
41+
The `ConfigurableRequisitionListItem` implementation adds the following attribute.
42+
43+
Attribute | Data Type | Description
44+
--- | --- | ---
45+
`configurable_options`| [SelectedConfigurableOption] | Selected configurable options for an item in the requisition list
46+
47+
### DownloadableRequisitionListItem attributes {#DownloadableRequisitionListItem}
48+
49+
The `ConfigurableRequisitionListItem` implementation adds the following attributes.
50+
51+
Attribute | Data Type | Description
52+
--- | --- | ---
53+
`links`| [DownloadableProductLinks] | An array of links for downloadable products in the requisition list
54+
`samples` | [DownloadableProductSamples] An array of links to downloadable product samples
55+
56+
### GiftCardRequisitionListItem attributes {#GiftCardRequisitionListItem}
57+
58+
The `GiftCardRequisitionListItem` implementation adds the following attributes.
59+
60+
Attribute | Data Type | Description
61+
--- | --- | ---
62+
`gift_card_options` | GiftCardOptions! | An array that defines gift card properties
63+
64+
#### GiftCardOptions attributes {#GiftCardOptions}
65+
66+
The GiftCardOptions object provides details about a gift card. All attributes are optional for a requisition list.
67+
68+
Attribute | Data Type | Description
69+
--- | --- | ---
70+
`amount`| Money | The amount and currency of the gift card
71+
`custom_giftcard_amount` | Money | The custom amount and currency of the gift card
72+
`message` | String | A message to the recipient
73+
`recipient_email` | String | The name of the person receiving the gift card
74+
`sender_email` | String | The email address of the person sending the gift card
75+
`sender_name` | String | The name of the person sending the gift card
76+
77+
### SimpleRequisitionListItem attributes {#SimpleRequisitionListItem}
78+
79+
The SimpleRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`.
80+
81+
### VirtualRequisitionListItem attributes {#VirtualRequisitionListItem}
82+
83+
The VirtualRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`.
84+
85+
## Example usage
86+
87+
The following mutation adds a product to a requisition list and returns information about the products in the list.
88+
89+
**Request:**
90+
91+
```graphql
92+
mutation {
93+
addProductsToRequisitionList(
94+
requisitionListUid: "Mg=="
95+
requisitionListItems: [
96+
{
97+
sku: "MS10"
98+
quantity: 1
99+
selected_options: ["Y29uZmlndXJhYmxlLzkzLzUw","Y29uZmlndXJhYmxlLzE2MC8xNjg"]
100+
}
101+
]
102+
) {
103+
requisition_list {
104+
uid
105+
items {
106+
items {
107+
... on RequisitionListItemInterface {
108+
uid
109+
product {
110+
uid
111+
sku
112+
name
113+
}
114+
quantity
115+
}
116+
}
117+
}
118+
items_count
119+
}
120+
}
121+
}
122+
```
123+
124+
**Response:**
125+
126+
```json
127+
{
128+
"data": {
129+
"addProductsToRequisitionList": {
130+
"requisition_list": {
131+
"uid": "Mg==",
132+
"items": {
133+
"items": [
134+
{
135+
"uid": "Mg==",
136+
"product": {
137+
"uid": "MTA=",
138+
"sku": "24-WB05",
139+
"name": "Savvy Shoulder Tote"
140+
},
141+
"quantity": 1
142+
},
143+
{
144+
"uid": "Mw==",
145+
"product": {
146+
"uid": "NTk2",
147+
"sku": "MS10",
148+
"name": "Logan HeatTec&reg; Tee"
149+
},
150+
"quantity": 1
151+
}
152+
]
153+
},
154+
"items_count": 2
155+
}
156+
}
157+
}
158+
}
159+
```

src/guides/v2.4/graphql/queries/customer.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -629,26 +629,6 @@ Attribute | Data Type | Description
629629

630630
{% include graphql/product-review.md %}
631631

632-
### Wishlist attributes {#Wishlist}
633-
634-
Attribute | Data type | Description
635-
--- | --- | ---
636-
`items` | [[WishlistItem](#wishlistitem)] | An array of items in the customer's wish list
637-
`items_count` | Int | The number of items in the wish list
638-
`id` | ID | The unique identifier of the wish list
639-
`sharing_code` | String | An encrypted code that Magento uses to link to the wish list
640-
`updated_at` | String | The time of the last modification to the wish list
641-
642-
#### WishlistItem attributes {#wishlistitem}
643-
644-
Attribute | Data type | Description
645-
--- | --- | ---
646-
`added_at` | String | The time when the customer added the item to the wish list
647-
`description` | String | The customer's comment about this item
648-
`id` | Int | The wish list item ID
649-
`product` | [ProductInterface]({{ page.baseurl }}/graphql/interfaces/product-interface.html) | The ProductInterface contains attributes that are common to all types of products. Note that descriptions may not be available for custom and EAV attributes
650-
`qty` | Float | The quantity of this wish list item
651-
652632
### Store credit attributes
653633

654634
In {{site.data.var.ee}}, the merchant can assign store credit to customers. Magento maintains the history of all changes to the balance of store credit available to the customer. The customer must be logged in to access the store credit history and balance.
@@ -694,6 +674,33 @@ Attribute | Data Type | Description
694674

695675
{% include graphql/wishlist.md %}
696676

677+
## B2B output attributes {#B2b}
678+
679+
If B2B is installed the `Customer` object can contain additional information.
680+
681+
### RequisitionListFilterInput attributes {#RequisitionListFilterInput}
682+
683+
The `RequisitionListFilterInput` object defines filters that limit the number of requisition lists returned.
684+
685+
Attribute | Data Type | Description
686+
--- | --- | ---
687+
`name` | FilterMatchTypeInput | Filter by the display name of the requisition list
688+
`uids` | FilterEqualTypeInput | Filter requisition lists by one or more requisition list IDs
689+
690+
### RequisitionList attributes {#RequisitionList}
691+
692+
{% include graphql/requisition-list.md %}
693+
694+
### RequisitionLists attributes {#RequisitionList}
695+
696+
The RequisitionLists object contains an array of requisition lists.
697+
698+
Attribute | Data Type | Description
699+
--- | --- | ---
700+
`items` | [[RequisitionList]](#RequisitionList) | An array of requisition lists
701+
`page_info` | SearchResultPageInfo | Contains pagination metadata
702+
`total_count` | Int | The number of returned requisition lists
703+
697704
## Related topics
698705

699706
* [isEmailAvailable query]({{page.baseurl}}/graphql/queries/is-email-available.html)

0 commit comments

Comments
 (0)