insertComponentToBOM
Adds a component to a BOM structure under a specified parent component.
Template for Mutation:
mutation InsertComponentToBOM($input: insertComponentToBOMInput!){
insertComponentToBOM(input: $input) {
# InsertComponentToBOMPayload Fields
}
}
Arguments
| input* insertComponentToBOMInput non-null | Input object for adding a component to a BOM. |
Possible Returns
| Value Type | Description |
|---|---|
| InsertComponentToBOMPayload | Represents response for inserting component in BOM. |
Examples
Example 1
Manually adds a component to the BOM of the parent component. Without options, the component is appended as a child of the parent.
Query:
mutation InsertComponentToBOM($input: InsertComponentToBOMInput!) {
insertComponentToBOM(input: $input) {
component {
id
name {
value
}
}
}
}
Query Variables:
{
"input": {
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35JdjlrWDU4YkN3Vmd1N1ZaZlRQR2NPX2FnYQ"
}
}
Response:
{
"data": {
"insertComponentToBOM": {
"component": {
"id": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"name": {
"value": "Assembly 1"
}
}
}
}
}
Example 2
Manually adds a component to the BOM directly below the given BOM relation using options.insertAfterBomRelationId. Use options.insertBeforeBomRelationId to insert above instead; the two options cannot be combined. Options are ignored when the child component already exists under the parent.
Query:
mutation InsertComponentToBOM($input: InsertComponentToBOMInput!) {
insertComponentToBOM(input: $input) {
component {
id
name {
value
}
}
}
}
Query Variables:
{
"input": {
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35JdjlrWDU4YkN3Vmd1N1ZaZlRQR2NPX2FnYQ",
"options": {
"insertAfterBomRelationId": "Ym9tcmVsYXRpb25-OWFiTWNGeEtnaFB5Y3d1TW9hR05pa19MMkN-TEtIRmVPRkk0Vk9NMU1DU2hrNDgzQg"
}
}
}
Response:
{
"data": {
"insertComponentToBOM": {
"component": {
"id": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"name": {
"value": "Assembly 1"
}
}
}
}
}
Example 3
Manually adds a component to the BOM and sets properties on the inserted BOM relation using options.properties. This example sets the component resolution (time override) to 1 (LATEST_CHANGE). Options are ignored when the child component already exists under the parent.
Query:
mutation InsertComponentToBOM($input: InsertComponentToBOMInput!) {
insertComponentToBOM(input: $input) {
component {
id
name {
value
}
}
}
}
Query Variables:
{
"input": {
"parentComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"childComponentId": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35JdjlrWDU4YkN3Vmd1N1ZaZlRQR2NPX2FnYQ",
"options": {
"properties": [
{
"propertyDefinitionId": "cHJvcGRlZn5RbUZ6WlZCeWIzQmxjblJwWlhOVGRHRm5hVzVuflNXNTBjbWx1YzJsalVISnZjR1Z5ZEdsbGMwZHliM1Z3VTNSbn5SMlZ1WlhKaGJBfnBhcmFtZXRlcnMuUW1GelpWQnliM0JsY25ScFpYTlRkR0ZuYVc1bjozNWM2OGFiMzFlNjk0MTAyOTNiODViNDQ4YjYwNDgzNi0xLjAuMA",
"value": 1
}
]
}
}
}
Response:
{
"data": {
"insertComponentToBOM": {
"component": {
"id": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ341SE1iR2Zsb1E0VjJMdDlzY1JVcUtZX2FnYQ",
"name": {
"value": "Assembly 1"
}
}
}
}
}