Queries
componentFromState
Retrieves a Component and its comparison data based on the specified state string.
Template for Query:
query GetComponentFromState($state: String!) {
componentFromState(state: $state) {
# Component Fields
}
}
Arguments
| state* String! non-null | The toComponentState string from a previously queried BOMRelation object. Used to continue traversal to subsequent levels. Includes comparison parameters and filters from the initial query. |
* Required
Possible Returns
| Value Type | Description |
|---|---|
| Component | An object representing an item in the bill of materials (BOM). It can be a part, an assembly, a sub-assembly or an end product which is the very top-level with no parent above it. |
Examples
Example 1
Retrieves a Component based on state retrieved from bomRelations query for each Component.
Query:
query GetComponentFromState(
$state: String!
- ) {
- componentFromState(state: $state) {
id name {
value
} isTip
Query Variables:
{
"state": "c3RhdGV-V09SS0lOR35udWxsfnsicm9vdFN0YXRlIjpudWxsLCJzdGF0ZSI6eyJhbmNlc3RvclNlY29uZGFyeVJlYXNvbiI6bnVsbCwiYW5jZXN0b3JTdHJ1Y3R1cmUiOiJERUZBVUxUIiwiY29tcG9zaXRpb24iOiJXT1JLSU5HIiwiaWQiOiJjSEp2WkhWamRINDVZV0pOWTBaNFMyZG9VSGxqZDNWTmIyRkhUbWxyWDB3eVEzNU1hVEp0UkV4RFIweHJPVFJqU1hKdWFXOU9VWEIyWDJGbllRIiwidGltZSI6bnVsbCwidHlwZSI6IkNPTVBPTkVOVCJ9fQ"
}
Response:
{
"data": {
"componentFromState": {
"id": "cHJvZHVjdH45YWJNY0Z4S2doUHljd3VNb2FHTmlrX0wyQ35MaTJtRExDR0xrOTRjSXJuaW9OUXB2X2FnYQ",
"name": {
"value": "Espresso Machine"
},
"isTip": true
}
}
}
Show More