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

Added documentation for copy, move and delete requisition list items mutations #8202

Merged
merged 17 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
15 changes: 15 additions & 0 deletions src/_data/toc/graphql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ pages:
- label: changeCustomerPassword mutation
url: /graphql/mutations/change-customer-password.html

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

- label: copyProductsToWishlist mutation
url: /graphql/mutations/copy-products-to-wishlist.html
edition: ee-only
Expand Down Expand Up @@ -305,6 +310,11 @@ pages:
edition: ee-only
exclude_versions: ["2.3"]

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

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

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

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

- label: removeStoreCreditFromCart mutation
url: /graphql/mutations/remove-store-credit.html
edition: ee-only
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
group: graphql
title: copyItemsBetweenRequisitionList mutation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mutation is now called copyItemsBetweenRequisitionLists (ends with an s). So much has changed in the schema for this mutation that it would be better to start over on this topic than try to point out all the differences. Note that the descriptions have been updated in the schema file. Use those where you can.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will modify accordingly.

b2b_only: true
contributor_name: Zilker Technology
contributor_link: https://www.ztech.io/
---
The copyItemsBetweenRequisitionList mutation copies items from one requisition list to another.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the btob_website_configuration_requisition_list_active attribute to determine whether requisition lists are supported.

## Syntax
```graphql
mutation {
copyItemsBetweenRequisitionList(
source_id: ID!,
destination_id: ID,
itemIds: [ID!]!,
) {
CopyItemsFromRequisitionListOutput
}
}
```

## Example usage

The following example copies items from one requisition list to another.
**Request:**
``` graphql
mutation {
copyItemsBetweenRequisitionList(
source_id: "4",
destination_id: "5",
itemIds: ["2","3"]
) {
source {
uid,
items_count
}
destination {
uid,
items_count
}
}
}
```
**Response:**
``` json
{
"data": {
"copyItemsBetweenRequisitionList": {
"source": {
"uid": "4",
"items_count": 2
},
"destination": {
"uid": "5",
"items_count": 2
}
}
}
}
```

## Input attributes

The copyItemsBetweenRequisitionList mutation requires the following input.

Attribute | Data Type | Description
--- | --- | ---
destination_id| ID! | The ID of the destination requisition list. If null, the mutation creates a new requisition list.
itemIds| [ID!]! | An array of selected requisition list items that are to be copied from source to destination.
source_id| ID! | The ID of the source requisition list.

## Output attributes

The copyItemsBetweenRequisitionList object returns the uid of the requisition list as well as the input attributes.

Attribute | Data Type | Description
--- | --- | ---
items_count | Int! | The number of products in the requisition list.
uid | ID! | The unique ID of the modified requisition list.

## Related topics

* [moveItemsBetweenRequisitionList mutation]({{page.baseurl}}/graphql/mutations/move-items-between-requisition-list.html)
* [removeRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/remove-requisition-list-items.html)
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here. The mutation is now named moveItemsBetweenRequisitionList, and there have been numerous schema changes.

group: graphql
title: moveItemsBetweenRequisitionList mutation
b2b_only: true
contributor_name: Zilker Technology
contributor_link: https://www.ztech.io/
---
The moveItemsBetweenRequisitionList mutation moves items from one requisition list to another.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the btob_website_configuration_requisition_list_active attribute to determine whether requisition lists are supported.

## Syntax
```graphql
mutation {
moveItemsBetweenRequisitionList(
source_id: ID!
destination_id: ID
itemIds: [ID!]!
) {
MoveItemsFromRequisitionListOutput
}
}
```

## Example usage

The following example moves items from one requisition list to another.
**Request:**
``` graphql
mutation {
moveItemsBetweenRequisitionList(
source_id: "4"
destination_id: "5"
itemIds: ["2","3"]
) {
source {
uid
items_count
}
destination {
uid
items_count
}
}
}
```
**Response:**
``` json
{
"data": {
"moveItemsBetweenRequisitionList": {
"source": {
"uid": "4",
"items_count": 0
},
"destination": {
"uid": "5",
"items_count": 2
}
}
}
}
```

## Input attributes

The moveItemsBetweenRequisitionList mutation requires the following input.

Attribute | Data Type | Description
--- | --- | ---
destination_id| ID! | The ID of the destination requisition list. If null, the mutation creates a new requisition list.
itemIds| [ID!]! | An array of selected requisition list items that are to be moved from source to destination.
source_id| ID! | The ID of the source requisition list.

## Output attributes

The moveItemsBetweenRequisitionList object returns the uid of the requisition list as well as the input attributes.

Attribute | Data Type | Description
--- | --- | ---
items_count | Int! | The number of products in the requisition list.
uid | ID! | The unique ID of the modified requisition list.

## Related topics

* [copyItemsBetweenRequisitionList mutation]({{page.baseurl}}/graphql/mutations/copy-items-between-requisition-list.html)
* [removeRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/remove-requisition-list-items.html)
79 changes: 79 additions & 0 deletions src/guides/v2.4/graphql/mutations/remove-requisition-list-items.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
group: graphql
title: removeRequisitionListItems mutation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now named deleteRequisitionListItems and the schema is now very different.

b2b_only: true
contributor_name: Zilker Technology
contributor_link: https://www.ztech.io/
---
The removeRequisitionListItems mutation removes items from the specified requisiton list for the logged in customer.

This mutation requires a valid [customer authentication token]({{page.baseurl}}/graphql/mutations/generate-customer-token.html).

{:.bs-callout-info}
Use the [storeConfig query]({{page.baseurl}}/graphql/queries/store-config.html) with the btob_website_configuration_requisition_list_active attribute to determine whether requisition lists are supported.

## Syntax
```graphql
mutation {
removeRequisitionListItems(
uid: ID!
items: [ID!]!
) {
RemoveRequisitionListItemsOutput
}
}
```
## Example usage

The following example removes the Frequently Ordered Products requisition list item by ID.

**Request:**
``` graphql
mutation {
removeRequisitionListItems(
uid: "4",
items: ["2","3"]
) {
list {
uid
items_count
}
}
}
```
**Response:**
``` json
{
"data": {
"removeRequisitionListItems": {
"list": {
"uid": "4",
"items_count": 0
}
}
}
}
```

## Input attributes

The removeRequisitionListItems mutation requires the following input.

Attribute | Data Type | Description
--- | --- | ---
items_count | [ID!]! | An array of items IDs corresponding to products to be removed from the requisition list.
uid| ID! | The unique ID of the requisition list to change.

## Output attributes

The removeRequisitionListItems object returns the uid of the requisition list as well as the input attributes.

Attribute | Data Type | Description
--- | --- | ---
items_count | Int! | The number of products in the requisition list.
uid | ID! | The unique ID of the modified requisition list.

## Related topics

* [renameRequisitionList mutation]({{page.baseurl}}/graphql/mutations/rename-requisition-list.html)
* [deleteRequisitionList mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list.html)