Bill of Materials Queries

Bill of Materials

A Bill of Materials (BOM) defines the components and quantities needed to manufacture a product variant.

Available fields

FieldTypeDescription
idIntUnique identifier.
labelStringBOM name.
descriptionStringOptional description.
activeBooleanWhether this BOM is active.
is_defaultBooleanWhether this is the default BOM for the variant.
variant_idIntID of the product variant.
company_idIntCompany ID.
created_atDateTimeCreation timestamp.
updated_atDateTimeLast update timestamp.
deleted_atDateTimeSoft delete timestamp.
variantVariantAssociated product variant.
components[BillOfMaterialComponent]List of components.

BillOfMaterialComponent

FieldTypeDescription
idIntUnique identifier.
bill_of_material_idIntParent BOM ID.
component_idIntComponent variant ID.
quantityFloatRequired quantity.
weightIntComponent weight.
componentVariantComponent variant.

BillOfMaterial

Returns a single bill of materials by id.

query GetBillOfMaterial($id: ID!) {
  BillOfMaterial(id: $id) {
    id
    label
    description
    active
    is_default
    variant_id
    created_at
    updated_at
    variant {
      id
      label
    }
    components {
      id
      quantity
      weight
      component {
        id
        label
      }
    }
  }
}

BillOfMaterials

Returns a paginated list of bills of materials with sorting and filters.

query BillOfMaterials(
  $variant_id: ID
  $active: Boolean
  $is_default: Boolean
  $orderBy: [QueryBillOfMaterialsOrderByOrderByClause!]
  $where: QueryBillOfMaterialsWhereWhereConditions
) {
  BillOfMaterials(
    variant_id: $variant_id
    active: $active
    is_default: $is_default
    orderBy: $orderBy
    where: $where
  ) {
    id
    label
    active
    is_default
    variant_id
    created_at
    variant {
      id
      label
    }
  }
}

Filters

The following fields can be used in the where parameter:

id, label, active, is_default, variant_id, component_variant_id, created_at, updated_at.