Mutations
bulkInsertComponentToBOM
Adds components to BOM structure in bulk under specified parent components.
Template for Mutation:
mutation BulkInsertComponentToBOM($input: [BulkInsertComponentToBOMInput!]!){
bulkInsertComponentToBOM(input: $input) {
# BulkInsertComponentToBOMPayload Fields
}
}
Arguments
| input* bulkInsertComponentToBOMInput non-null | Input array for adding multiple components to BOM. |
* Required
Possible Returns
| Value Type | Description |
|---|---|
| BulkInsertComponentToBOMPayload | Return payload for bulk insert component to BOM operation. |
Examples
Example 1
ATTP: Re-adds Child1 and Child2 to the RFTP Parent BOM after bulkRemoveComponentFromBOM (RFTP). Run after RFTP to restore the excluded children.
Query:
mutation BulkInsertComponentToBOM($input: [BulkInsertComponentToBOMInput!]!) {
bulkInsertComponentToBOM(input: $input) {
results {
inputKey
error {
code
message
}
}
}
}
Show More
Query Variables:
{
"input": [
{
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35DUG1iYzFQbVdMakpKazNwbjdyYXVVX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35YelJGd05LZE9NTGcxZHl6SEJqSzlOX2FnYQ",
"inputKey": "child1"
},
{
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35DUG1iYzFQbVdMakpKazNwbjdyYXVVX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ345aHU1TVRZdXRaOHNsNHRTTlBORlZWX2FnYQ",
"inputKey": "child2"
}
]
}
Show More
Response:
{
"data": {
"bulkInsertComponentToBOM": {
"results": [
{
"inputKey": "child1",
"error": null
},
{
"inputKey": "child2",
"error": {
"code": "BAD_REQUEST",
"message": "Cannot insert a reference-only component into the BOM."
}
}
]
}
}
}
Show More
Example 2
Manually adds multiple components to the BOM in a single request. Each item can have its own options: child1 is inserted above the given BOM relation, child2 is inserted with component resolution (time override) set to 1 (LATEST_CHANGE). Options are ignored when the child component already exists under the parent.
Query:
mutation BulkInsertComponentToBOM($input: [BulkInsertComponentToBOMInput!]!) {
bulkInsertComponentToBOM(input: $input) {
results {
inputKey
error {
code
message
}
}
}
}
Show More
Query Variables:
{
"input": [
{
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35JdjlrWDU4YkN3Vmd1N1ZaZlRQR2NPX2FnYQ",
"inputKey": "child1",
"options": {
"insertBeforeBomRelationId": "Ym9tcmVsYXRpb25-OWFiTWNGeEtnaFB5Y3d1TW9hR05pa19MMkN-TEtIRmVPRkk0Vk9NMU1DU2hrNDgzQg"
}
},
{
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35OclllblZyUXhlMWVyTFZJc1ZPOWYxX2FnYQ",
"inputKey": "child2",
"options": {
"properties": [
{
"propertyDefinitionId": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflNXNTBjbWx1YzJsalVISnZjR1Z5ZEdsbGMwZHliM1Z3VTNSbn5SMlZ1WlhKaGJBfnBhcmFtZXRlcnMuUW1GelpWQnliM0JsY25ScFpYTlRkR0ZuYVc1bjozNWM2OGFiMzFlNjk0MTAyOTNiODViNDQ4YjYwNDgzNi0xLjAuMA",
"value": 1
}
]
}
}
]
}
Show More
Response:
{
"data": {
"bulkInsertComponentToBOM": {
"results": [
{
"inputKey": "child1",
"error": null
},
{
"inputKey": "child2",
"error": null
}
]
}
}
}
Show More