Parts and Part Revisioning

Parts:

Part objects in ion represent abstractions that carry information about a particular part, while the physical parts themselves are part inventory objects. The part objects dictate the MBOM, revision, supplier part number, tracking type and other additional attributes about a part.

Below is a list of part attributes and their description. For a more complete list of part fields use the graphiql editor to view the part object.

Part Object

Description

id

Unique identifier of Part object

partNumber

parts must have a unique partNumber and revision

revision

Revision for part, defaults to A

trackingType

If set enforces all inventory for part to match tracking type. Can be either "serial" or "lot"

quantity

The summed quantity of all inventory for a part

partsInventory

List of inventory objects related to a part

runs

List of runs related to part

mbom

List of MBOM item which describe the BOM of a part

Query Parts

The queries below specify how to list parts by a filter or get a specific part.

List
Filter Inputs
Get
List
query GetParts($filters: PartsInputFilters) {
parts(filters: $filters) {
edges {
node {
id partNumber description thumbnail { s3Key s3Bucket url }
fileAttachments { url } quantity
}
}
}
}
Filter Inputs
{
"filters": {
"partNumber": {
"eq": "ion-12"
}
}
}
Get
query GetPart{
part(id: 1) {
id partNumber description quantity
}
}

Create Part

Creates a part object with a particular part number. Part number and revision must be unique, if no revision is supplied in the create mutation then the part defaults to revision A. Once created the revision of a part cannot be updated, instead the createPartRevision mutation must be used to iterate a part's revision. Returns the new part.

Mutation
Inputs
Mutation
mutation CreatePart($input: CreatePartInput!) {
createPart(input: $input) {
part {
id revision partNumber description
}
}
}
Inputs
{
"input": {
"partNumber": "ion-12",
"description": "Part for API docs.",
"revision": "C"
}
}

Mutation to create part object

Update Part

Updates a part object. Tracking type can only be updated to either "serial" or "lot" if all existing inventory objects related to this part conform to the new tracking type. Returns the updated part object.

Mutation
Inputs
Mutation
mutation UpdatePart($input: UpdatePartInput!) {
updatePart(input: $input) {
part { id partNumber description revision }
}
}
Inputs
{
"input": {
"id": 1,
"etag": "etag1",
"partNumber": "ion-13",
"description": "Updated part for API docs."
}
}

Mutation to update part object

Create Part Revision

Creates a new revision for a particular part. A revision can be generated from any part, there are no restrictions requiring the revision to be generated from the current latest revision. For example if our part "ion-13" has existing revisions A and B, then a third revision C can be generated from either existing revision A or B. All information in the new revision is copied over from the old revision unless explicitly overriden in the mutation input. The new revision will be the next valid alphabetic character from the part's latest revision. If the part's latest revision is C, then the new revision will be D. If the part's latest revision is Z, then the new revision will be AA. Returns the newly created part object with the updated revision.

Mutation
Inputs
Mutation
mutation CreatePartRevision($input: CreatePartRevisionInput!) {
createPartRevision(input: $input) {
part {
id partNumber revision
}
}
}
Inputs
{
"input": {
"id": 1,
"etag": "etag1",
"description": "New revision for part in API docs."
}
}

Mutation to create a part revision

Delete Part

Delete a part object. This will delete not only the part object itself but also cascade and delete the MBOM and MBOM substitutes associated with this part. A part which has existing inventory or was used within a run cannot be deleted. Returns the ID of the deleted part.

Mutation
Inputs
Mutation
mutation DeletePart($id: ID!, $etag: String!) {
deletePart(id: $id, etag: $etag) {
id
}
}
Inputs
{
"id": 1,
"etag": "etag1"
}

Mutation to delete part object

Query to retrieve parts