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
Added documentation for copy, move and delete requisition list items mutations #8202
Merged
keharper
merged 17 commits into
magento:requisition-lists
from
sathiyaaa:requision-list-mutations
Dec 11, 2020
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5316300
Added documentation for copy, move and remove requisition list items …
sathiyaaa 2c29f11
fixed json format
sathiyaaa c430d18
arranged the attributes alphabetically
sathiyaaa a1b2663
added backticks and spaces as mentioned
sathiyaaa 49983fe
Update src/guides/v2.4/graphql/mutations/copy-items-between-requisiti…
sathiyaaa b187eca
modified attribute name
sathiyaaa 3871c1d
Merge branch 'requision-list-mutations' of github.com:sathiyaaa/devdo…
sathiyaaa b8d7bfc
Modified the documentation according to the schema change
sathiyaaa 733a56b
Apply suggestions from code review
sathiyaaa b94b290
modified as per review comments
sathiyaaa 467de12
modified as per review comments
sathiyaaa 1e1d39c
removed a period
sathiyaaa 1d2e629
added a missing attribute
sathiyaaa a580df4
added the attributes alphabetically
sathiyaaa 936adaf
deleted extra line
sathiyaaa 86dc970
modified a description
sathiyaaa 49832fb
modified the uid's and item uid's
sathiyaaa 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
The `RequisitionList` object contains the following attributes. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`description` | String | Optional text that describes the requisition list | ||
`items` | 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 |
96 changes: 96 additions & 0 deletions
96
src/guides/v2.4/graphql/mutations/copy-items-between-requisition-lists.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,96 @@ | ||
--- | ||
group: graphql | ||
title: copyItemsBetweenRequisitionLists mutation | ||
b2b_only: true | ||
contributor_name: EY | ||
--- | ||
The `copyItemsBetweenRequisitionLists` 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 { | ||
copyItemsBetweenRequisitionLists( | ||
sourceRequisitionListUid: ID!, | ||
destinationRequisitionListUid: ID, | ||
requisitionListItem: CopyItemsBetweenRequisitionListsInput | ||
) { | ||
CopyItemsFromRequisitionListsOutput | ||
} | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example copies items from one requisition list to another. | ||
|
||
**Request:** | ||
|
||
``` graphql | ||
mutation { | ||
copyItemsBetweenRequisitionLists( | ||
sourceRequisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz", | ||
destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz", | ||
requisitionListItemUids: ["2","3"] | ||
) { | ||
requisition_list { | ||
uid | ||
items_count | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
``` json | ||
{ | ||
"data": { | ||
"copyItemsBetweenRequisitionLists": { | ||
"requisition_list": { | ||
"uid": "W16uZmlndXJhYmxlLakzLzUz", | ||
"items_count": 2 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `copyItemsBetweenRequisitionLists` mutation requires the following input. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`destinationRequisitionListUid`| ID | The unique ID of the destination requisition list. If null, a new requisition list will be created | ||
`requisitionListItem`| [[CopyItemsBetweenRequisitionListsInput](#CopyItemsBetweenRequisitionListsInput)] | An array of selected requisition list items that are to be copied | ||
`sourceRequisitionListUid`| ID! | The unique ID of the source requisition list | ||
|
||
## Output attributes | ||
|
||
The `copyItemsBetweenRequisitionLists` mutation returns the requisition list object to which the products were copied to. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after the items were copied | ||
|
||
### CopyItemsBetweenRequisitionListsInput attributes {#CopyItemsBetweenRequisitionListsInput} | ||
|
||
The `CopyItemsBetweenRequisitionListsInput` type contains the list of products to copy from one requisition list to other. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`requisitionListItemUids` | [ID!]! | An array of IDs representing products copied from one requisition list to another | ||
|
||
### RequisitionList attributes {#RequisitionList} | ||
{% include graphql/requisition-list.md %} | ||
|
||
## Related topics | ||
|
||
* [moveItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/move-items-between-requisition-lists.html) | ||
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.html) |
81 changes: 81 additions & 0 deletions
81
src/guides/v2.4/graphql/mutations/delete-requisition-list-items.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,81 @@ | ||
--- | ||
group: graphql | ||
title: deleteRequisitionListItems mutation | ||
b2b_only: true | ||
contributor_name: EY | ||
--- | ||
The `deleteRequisitionListItems` 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 { | ||
deleteRequisitionListItems( | ||
requisitionListUid: ID! | ||
requisitionListItemUids: [ID!]! | ||
) { | ||
DeleteRequisitionListItemsOutput | ||
} | ||
} | ||
``` | ||
## Example usage | ||
|
||
The following example removes the specified items from the requisition list. | ||
|
||
**Request:** | ||
|
||
``` graphql | ||
mutation { | ||
deleteRequisitionListItems( | ||
requisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz", | ||
requisitionListItemUids: ["2","3"] | ||
) { | ||
requisition_list { | ||
uid | ||
items_count | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
``` json | ||
{ | ||
"data": { | ||
"deleteRequisitionListItems": { | ||
"requisition_list": { | ||
"uid": "Y29uZmlndXJhYmxlLzkzLzUz", | ||
"items_count": 0 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `deleteRequisitionListItems` mutation requires the following input. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`requisitionListItemUids`| [ID!]! | An array of UIDs representing products to be removed from the requisition list | ||
`requisitionListUid`| ID! | The unique ID of the requisition list | ||
|
||
## Output attributes | ||
|
||
The `deleteRequisitionListItems` object returns the requisition list after the deletion of items. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`requisition_list` | RequisitionList | The requisition list after removing items | ||
|
||
## Related topics | ||
|
||
* [renameRequisitionList mutation]({{page.baseurl}}/graphql/mutations/rename-requisition-list.html) | ||
* [deleteRequisitionList mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list.html) |
105 changes: 105 additions & 0 deletions
105
src/guides/v2.4/graphql/mutations/move-items-between-requisition-lists.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,105 @@ | ||
--- | ||
group: graphql | ||
title: moveItemsBetweenRequisitionLists mutation | ||
b2b_only: true | ||
contributor_name: EY | ||
--- | ||
The `moveItemsBetweenRequisitionLists` 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 { | ||
moveItemsBetweenRequisitionLists( | ||
sourceRequisitionListUid: ID! | ||
destinationRequisitionListUid: ID | ||
requisitionListItem: MoveItemsBetweenRequisitionListsInput | ||
) { | ||
MoveItemsBetweenRequisitionListsOutput | ||
} | ||
} | ||
``` | ||
|
||
## Example usage | ||
|
||
The following example moves items from one requisition list to another. | ||
|
||
**Request:** | ||
|
||
``` graphql | ||
mutation { | ||
sathiyaaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
moveItemsBetweenRequisitionLists( | ||
sourceRequisitionListUid: "Y29uZmlndXJhYmxlLzkzLzUz" | ||
destinationRequisitionListUid: "W16uZmlndXJhYmxlLakzLzUz" | ||
requisitionListItemUids: ["2","3"] | ||
) { | ||
source_requisition_list { | ||
uid | ||
items_count | ||
} | ||
destination_requisition_list { | ||
uid | ||
items_count | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Response:** | ||
|
||
``` json | ||
{ | ||
"data": { | ||
"moveItemsBetweenRequisitionLists": { | ||
"source_requisition_list": { | ||
"uid": "Y29uZmlndXJhYmxlLzkzLzUz", | ||
"items_count": 0 | ||
}, | ||
"destination_requisition_list": { | ||
"uid": "W16uZmlndXJhYmxlLakzLzUz", | ||
"items_count": 2 | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Input attributes | ||
|
||
The `moveItemsBetweenRequisitionLists` mutation requires the following input. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`destinationRequisitionListUid`| ID! | The unique ID of the destination requisition list. If null, a new requisition list will be created | ||
`requisitionListItem`| [[MoveItemsBetweenRequisitionListsInput](#MoveItemsBetweenRequisitionListsInput)] | An array of selected requisition list items that are to be moved from the source to the destination list | ||
`sourceRequisitionListUid`| ID! | The unique ID of the source requisition list | ||
|
||
## Output attributes | ||
|
||
The `moveItemsBetweenRequisitionLists` object returns the source requisition list and the destination requisition list object. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`destination_requisition_list` | [[RequisitionList](#RequisitionList)] | The destination requisition list after moving items | ||
`source_requisition_list` | [[RequisitionList](#RequisitionList)] | The source requisition list after moving items | ||
|
||
### MoveItemsBetweenRequisitionListsInput attributes {#MoveItemsBetweenRequisitionListsInput} | ||
|
||
The `MoveItemsBetweenRequisitionListsInput` type contains the list of products to move from one requisition list to other. | ||
|
||
Attribute | Data Type | Description | ||
--- | --- | --- | ||
`requisitionListItemUids` | [ID!]! | An array of IDs representing products moved from one requisition list to another | ||
|
||
### RequisitionList attributes {#RequisitionList} | ||
{% include graphql/requisition-list.md %} | ||
|
||
## Related topics | ||
|
||
* [copyItemsBetweenRequisitionLists mutation]({{page.baseurl}}/graphql/mutations/copy-items-between-requisition-lists.html) | ||
* [deleteRequisitionListItems mutation]({{page.baseurl}}/graphql/mutations/delete-requisition-list-items.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.
Uh oh!
There was an error while loading. Please reload this page.