This repository was archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GraphQL: Requisition list updates #8408
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
159 changes: 159 additions & 0 deletions
159
src/guides/v2.4/graphql/interfaces/requisition-list-item-interface.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
--- | ||
group: graphql | ||
title: RequisitionListItemInterface attributes and implementations | ||
--- | ||
|
||
`RequisitionListItemInterface` provides details about items in a requisition list. It has the following implementations: | ||
|
||
* [`BundleRequisitionListItem`](#BundleRequisitionListItem) | ||
* [`ConfigurableRequisitionListItem`](#ConfigurableRequisitionListItem) | ||
* [`DownloadableRequisitionListItem`](#DownloadableRequisitionListItem) | ||
* [`GiftCardRequisitionListItem`](#GiftCardRequisitionListItem) | ||
* [`SimpleRequisitionListItem`](#SimpleRequisitionListItem) | ||
* [`VirtualRequisitionListItem`](#VirtualRequisitionListItem) | ||
|
||
{:.bs-callout-info} | ||
There is not an implementation for grouped products. The items within a grouped product are managed individually. | ||
|
||
## Attributes | ||
|
||
The `RequisitionListItemInterface` defines the following attributes. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`customizable_options`: [SelectedCustomizableOption] | Selected custom options for an item in the requisition list | ||
`product` | [ProductInterface!]({{page.baseurl}}/graphql/interfaces/product-interface.html) | Contains details about an item added to a requisition list | ||
`quantity` | Float! | The amount added | ||
`uid` | ID! | The unique ID for the requisition list item | ||
|
||
## Implementations | ||
|
||
### BundleRequisitionListItem attributes {#BundleRequisitionListItem} | ||
|
||
The `BundleRequisitionListItem` implementation adds the following attribute. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`bundle_options`| [SelectedBundleOption]! | An array of selected options for a bundle product | ||
|
||
### ConfigurableRequisitionListItem attributes {#ConfigurableRequisitionListItem} | ||
|
||
The `ConfigurableRequisitionListItem` implementation adds the following attribute. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`configurable_options`| [SelectedConfigurableOption] | Selected configurable options for an item in the requisition list | ||
|
||
### DownloadableRequisitionListItem attributes {#DownloadableRequisitionListItem} | ||
|
||
The `ConfigurableRequisitionListItem` implementation adds the following attributes. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`links`| [DownloadableProductLinks] | An array of links for downloadable products in the requisition list | ||
`samples` | [DownloadableProductSamples] An array of links to downloadable product samples | ||
|
||
### GiftCardRequisitionListItem attributes {#GiftCardRequisitionListItem} | ||
|
||
The `GiftCardRequisitionListItem` implementation adds the following attributes. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`gift_card_options` | GiftCardOptions! | An array that defines gift card properties | ||
|
||
#### GiftCardOptions attributes {#GiftCardOptions} | ||
|
||
The GiftCardOptions object provides details about a gift card. All attributes are optional for a requisition list. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`amount`| Money | The amount and currency of the gift card | ||
`custom_giftcard_amount` | Money | The custom amount and currency of the gift card | ||
`message` | String | A message to the recipient | ||
`recipient_email` | String | The name of the person receiving the gift card | ||
`sender_email` | String | The email address of the person sending the gift card | ||
`sender_name` | String | The name of the person sending the gift card | ||
|
||
### SimpleRequisitionListItem attributes {#SimpleRequisitionListItem} | ||
|
||
The SimpleRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`. | ||
|
||
### VirtualRequisitionListItem attributes {#VirtualRequisitionListItem} | ||
|
||
The VirtualRequisitionListItem data type does not provide additional attributes to the `RequisitionListItemInterface`. | ||
|
||
## Example usage | ||
|
||
The following mutation adds a product to a requisition list and returns information about the products in the list. | ||
|
||
**Request:** | ||
|
||
```graphql | ||
mutation { | ||
addProductsToRequisitionList( | ||
requisitionListUid: "Mg==" | ||
requisitionListItems: [ | ||
{ | ||
sku: "MS10" | ||
quantity: 1 | ||
selected_options: ["Y29uZmlndXJhYmxlLzkzLzUw","Y29uZmlndXJhYmxlLzE2MC8xNjg"] | ||
} | ||
] | ||
) { | ||
requisition_list { | ||
uid | ||
items { | ||
items { | ||
... on RequisitionListItemInterface { | ||
uid | ||
product { | ||
uid | ||
sku | ||
name | ||
} | ||
quantity | ||
} | ||
} | ||
} | ||
items_count | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
```json | ||
{ | ||
"data": { | ||
"addProductsToRequisitionList": { | ||
"requisition_list": { | ||
"uid": "Mg==", | ||
"items": { | ||
"items": [ | ||
{ | ||
"uid": "Mg==", | ||
"product": { | ||
"uid": "MTA=", | ||
"sku": "24-WB05", | ||
"name": "Savvy Shoulder Tote" | ||
}, | ||
"quantity": 1 | ||
}, | ||
{ | ||
"uid": "Mw==", | ||
"product": { | ||
"uid": "NTk2", | ||
"sku": "MS10", | ||
"name": "Logan HeatTec® Tee" | ||
}, | ||
"quantity": 1 | ||
} | ||
] | ||
}, | ||
"items_count": 2 | ||
} | ||
} | ||
} | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -629,26 +629,6 @@ Attribute | Data Type | Description | |||||
|
||||||
{% include graphql/product-review.md %} | ||||||
|
||||||
### Wishlist attributes {#Wishlist} | ||||||
|
||||||
Attribute | Data type | Description | ||||||
--- | --- | --- | ||||||
`items` | [[WishlistItem](#wishlistitem)] | An array of items in the customer's wish list | ||||||
`items_count` | Int | The number of items in the wish list | ||||||
`id` | ID | The unique identifier of the wish list | ||||||
`sharing_code` | String | An encrypted code that Magento uses to link to the wish list | ||||||
`updated_at` | String | The time of the last modification to the wish list | ||||||
|
||||||
#### WishlistItem attributes {#wishlistitem} | ||||||
|
||||||
Attribute | Data type | Description | ||||||
--- | --- | --- | ||||||
`added_at` | String | The time when the customer added the item to the wish list | ||||||
`description` | String | The customer's comment about this item | ||||||
`id` | Int | The wish list item ID | ||||||
`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 | ||||||
`qty` | Float | The quantity of this wish list item | ||||||
|
||||||
### Store credit attributes | ||||||
|
||||||
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 | |||||
|
||||||
{% include graphql/wishlist.md %} | ||||||
|
||||||
## B2B output attributes {#B2b} | ||||||
|
||||||
If B2B is installed the `Customer` object can contain additional information. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
### RequisitionListFilterInput attributes {#RequisitionListFilterInput} | ||||||
|
||||||
The `RequisitionListFilterInput` object defines filters that limit the number of requisition lists returned. | ||||||
|
||||||
Attribute | Data Type | Description | ||||||
--- | --- | --- | ||||||
`name` | FilterMatchTypeInput | Filter by the display name of the requisition list | ||||||
`uids` | FilterEqualTypeInput | Filter requisition lists by one or more requisition list IDs | ||||||
|
||||||
### RequisitionList attributes {#RequisitionList} | ||||||
|
||||||
{% include graphql/requisition-list.md %} | ||||||
|
||||||
### RequisitionLists attributes {#RequisitionList} | ||||||
|
||||||
The RequisitionLists object contains an array of requisition lists. | ||||||
|
||||||
Attribute | Data Type | Description | ||||||
--- | --- | --- | ||||||
`items` | [[RequisitionList]](#RequisitionList) | An array of requisition lists | ||||||
`page_info` | SearchResultPageInfo | Contains pagination metadata | ||||||
`total_count` | Int | The number of returned requisition lists | ||||||
|
||||||
## Related topics | ||||||
|
||||||
* [isEmailAvailable query]({{page.baseurl}}/graphql/queries/is-email-available.html) | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.