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

GraphQL: Merge requisition lists docs into 2.4.2-develop #8428

Merged
merged 16 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 53 additions & 13 deletions src/_data/toc/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,20 @@ pages:
- label: addDownloadableProductsToCart mutation
url: /graphql/mutations/add-downloadable-products.html

- label: addProductsToRequisitionList mutation
url: /graphql/mutations/add-products-to-requisition-list.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: addProductsToWishlist mutation
url: /graphql/mutations/add-products-to-wishlist.html
exclude_versions: ["2.3"]

- label: addRequisitionListItemsToCart mutation
url: /graphql/mutations/add-requisition-list-items-to-cart.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: addSimpleProductsToCart mutation
url: /graphql/mutations/add-simple-products.html

Expand All @@ -210,6 +220,16 @@ pages:
- label: changeCustomerPassword mutation
url: /graphql/mutations/change-customer-password.html

- label: clearCustomerCart mutation
url: /graphql/mutations/clear-customer-cart.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: copyItemsBetweenRequisitionLists mutation
url: /graphql/mutations/copy-items-between-requisition-lists.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: copyProductsBetweenWishlists mutation
url: /graphql/mutations/copy-products-between-wishlists.html
edition: ee-only
Expand Down Expand Up @@ -293,19 +313,24 @@ pages:
- label: deleteCustomerAddress mutation
url: /graphql/mutations/delete-customer-address.html

- label: deleteWishlist mutation
url: /graphql/mutations/delete-wishlist.html
edition: ee-only
exclude_versions: ["2.3"]

- label: deletePaymentToken mutation
url: /graphql/mutations/delete-payment-token.html

- label: deleteRequisitionList mutation
url: /graphql/mutations/delete-requisition-list.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: deleteRequisitionListItems mutation
url: /graphql/mutations/delete-requisition-list-items.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: deletePaymentToken mutation
url: /graphql/mutations/delete-payment-token.html

- label: deleteWishlist mutation
url: /graphql/mutations/delete-wishlist.html
edition: ee-only
exclude_versions: ["2.3"]

- label: generateCustomerToken mutation
url: /graphql/mutations/generate-customer-token.html

Expand All @@ -324,6 +349,11 @@ pages:
edition: ee-only
exclude_versions: ["2.3"]

- label: moveItemsBetweenRequisitionLists mutation
url: /graphql/mutations/move-items-between-requisition-lists.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: placeOrder mutation
url: /graphql/mutations/place-order.html

Expand Down Expand Up @@ -354,11 +384,6 @@ pages:
url: /graphql/mutations/remove-store-credit.html
edition: ee-only

- label: renameRequisitionList mutation
url: /graphql/mutations/rename-requisition-list.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: reorderItems mutation
url: /graphql/mutations/reorder-items.html
exclude_versions: ["2.3"]
Expand Down Expand Up @@ -449,6 +474,16 @@ pages:
url: /graphql/mutations/update-products-in-wishlist.html
exclude_versions: ["2.3"]

- label: updateRequisitionList mutation
url: /graphql/mutations/update-requisition-list.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: updateRequisitionListItems mutation
url: /graphql/mutations/update-requisition-list-items.html
edition: b2b-only
exclude_versions: [ "2.3" ]

- label: updateWishlist mutation
url: /graphql/mutations/update-wishlist.html
edition: ee-only
Expand Down Expand Up @@ -505,6 +540,11 @@ pages:
url: /graphql/interfaces/order-item-interface.html
exclude_versions: ["2.3"]

- label: RequisitionListItemInterface attributes and implementations
url: /graphql/interfaces/requisition-list-item-interface.html
edition: b2b-only
exclude_versions: ["2.3"]

- label: ShipmentItemInterface attributes and implementations
url: /graphql/interfaces/shipment-item-interface.html
exclude_versions: ["2.3"]
Expand Down
10 changes: 6 additions & 4 deletions src/_includes/graphql/customer-output-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,25 @@ Attribute | Data Type | Description
`firstname` | String | The customer's first name
`gender` | Int | The customer's gender (Male - 1, Female - 2)
`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)
`id` | Int | Deprecated. This attribute is not applicable for GraphQL.The ID assigned to the customer
`id` | Int | Deprecated. This attribute is not applicable for GraphQL. The ID assigned to the customer
`is_subscribed` | Boolean | Indicates whether the customer is subscribed to the company's newsletter
`lastname` | String | The customer's family name
`middlename` |String | The customer's middle name
`orders(<FilterCriteria>)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }}
`orders(filter CustomerOrdersFilterInput, currentPage = 1 Int, pageSize = 20 Int)` | {{ customeroutput_text }} | A list of the customer's placed orders{{ crossref_text }}
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
`reviews(pageSize: Int = 20 currentPage: Int = 1)` | {{ productreview_text }} | The list of reviews of the product
`reward_points` | {{ rewardpoints_text }} | Details about the customer's reward points
`suffix` | String | A value such as Sr., Jr., or III
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
`wishlist` | {{ wishlist_text }} | Contains the contents of the customer's wish lists
`wishlist` | Wishlist! | Deprecated. Use `wishlist_v2` instead. Contains the contents of the customer's wish lists
`wishlist_v2(id ID!)` | {{ wishlist_text }} | Retrieve the specified wish list identified by the unique ID for a Wishlist object

For B2B, company users can have the following attributes.
For B2B, company administrators and users can have the following attributes.

Attribute | Data Type | Description
--- | --- | ---
`job_title` | String | The job title for a B2B company user
`requisition_lists (pageSize = 20 Int, currentPage = 1 Int, filter RequisitionListFilterInput)` | RequisitionLists | Contains the customer's requisition lists
`role`| CompanyRole | The role name and permissions assigned to the company user
`status` | CompanyUserStatusEnum | Indicates whether the company user is ACTIVE or INACTIVE
`team` | CompanyTeam | The team the company user is assigned to
Expand Down
20 changes: 20 additions & 0 deletions src/_includes/graphql/requisition-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The `RequisitionList` object contains the following attributes.

Attribute | Data Type | Description
--- | --- | ---
`description` | String | Optional text that describes the requisition list
`items` | [RequistionListItems](#RequistionListItems) | An array of products added to the requisition list
`items_count` | Int! | The number of items in the list
`name` | String! | The requisition list name
`uid` | ID! | The unique requisition list ID
`updated_at` | String | The time of the last modification of the requisition list

### RequistionListItems attributes {#RequistionListItems}

The `RequistionListItems` object contains the following attributes.

Attribute | Data Type | Description
--- | --- | ---
`items` | [[RequisitionListItemInterface]!]({{page.baseurl}}/graphql/interfaces/requisition-list-item-interface.html) | An array of items in the requisition list
`page_info` | SearchResultPageInfo | Contains pagination metadata
`total_pages` | Int! | The number of pages returned
2 changes: 1 addition & 1 deletion src/_includes/graphql/store-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Attribute | Data Type | Description | Default or example value
`base_media_url` | String | The fully-qualified URL that specifies the location of user media files | `http://magentohost.example.com/pub/media/`
`base_static_url` | String | The fully-qualified URL that specifies the location of static view files | `http://magentohost.example.com/pub/static/`
`base_url` | String | The store's fully-qualified base URL | `http://magentohost.example.com/`
`btob_website_configuration_requisition_list_active` | String | Indicates if requisition lists are enabled. Possible values: 1 (Yes) and 0 (No) | 0
`cart_gift_wrapping` | String | Indicates if gift wrapping prices are displayed on the Shopping Cart page. Possible values: 1 (Yes) and 0 (No) | 1
`cart_printed_card` | String | Indicates if printed card prices are displayed on the Shopping Cart page. Possible values: 1 (Yes) and 0 (No) | 1
`catalog_default_sort_by` | String | The default sort order of the search results list | `position`
Expand All @@ -42,6 +41,7 @@ Attribute | Data Type | Description | Default or example value
`id` | Int | Deprecated. Use `store_code` instead. The ID number assigned to the store | `1`
`is_default_store` | Boolean | Indicates whether the store view has been designated as the default within the store group | true or false
`is_default_store_group` | Boolean | Indicates whether the store group has been designated as the default within the website | true or false
`is_requisition_list_active` | String | Indicates if requisition lists are enabled. Possible values: 1 (Yes) and 0 (No) | 0
`list_mode` | String | The format of the search results list | `grid-list`
`list_per_page` | Int | The default number of products per page in List View | `10`
`list_per_page_values` | String | A list of numbers that define how many products can be displayed in List View | `5,10,15,20,25`
Expand Down
160 changes: 160 additions & 0 deletions src/guides/v2.4/graphql/interfaces/requisition-list-item-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
group: graphql
title: RequisitionListItemInterface attributes and implementations
b2b_only: true
---

`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 attribute.

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&reg; Tee"
},
"quantity": 1
}
]
},
"items_count": 2
}
}
}
}
```
Loading