Skip to main content

Tags

Tags are used to categorize and organize content, making it easier for users to find related items.

Schema​

Tags​

NameTypeDescriptionExample
idIDThe unique tag ID"ckmnpybisiy5x08abky4g2d1f"
titlestringA unique name which describes the tag"Important"
typeTagType?Type of resource the tag belongs toORDER, INVENTORY_ITEM, REQUISITION, TOOL
colorColor?The color of the tag in the UI. Not required, but if provided, must use one of the defined hex codes, including the # prefix"#95de64"
createdAtDateTimeWhen this object was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this object was last updated"2021-03-24 17:26:46.983Z"

TagType​

Allowed values: ORDER, INVENTORY_ITEM, REQUISITION, TOOL

Color​

Allowed values:

ValueDescription
#ff85c0magenta
#ff7875red
#ff9c6evolcano
#ffc069orange
#ffd666gold
#d3f261lime
#95de64green
#5cdbd3cyan
#69b1ffblue
#85a5ffgeekblue
#b37febpurple
#f0f0f0grey

Queries​

tags​

Returns a list of all tags for the organization.

Parameters​

Accepts all standard pagination parameters.

Allowed orderBy fields: id, createdAt, title, color, updatedAt, type.

Allowed filter fields: id, createdAt, title, color, updatedAt, type.

Response​

A list of Tag objects.

Example Query​

query {
tags {
id
title
type
color
}
}

Example Response​

[
{
"title": "Important",
"color": "#ff85c0",
"type": "ORDER",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#ff7875",
"type": "ORDER",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]

getOrderTags​

Returns a list of all tags for an order.

Parameters​

NameDescriptionExample
orderIdThe ID of the order of the tags to fetch"ckmnpybisiy5x08abky4g2d1f"

Accepts all standard pagination parameters.

Allowed orderBy fields: id, createdAt, title, color, updatedAt, type.

Allowed filter fields: id, createdAt, title, color, updatedAt, type.

Response​

A list of Tag objects.

Example Query​

query {
getOrderTags(orderId: "ckmnpybisiy5x08abky4g2d1f") {
id
title
type
color
}
}

Example Response​

[
{
"title": "Important",
"color": "#ff7875",
"type": "ORDER",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#ff9c6e",
"type": "ORDER",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]

Mutations​

addNewOrExistingTagsToOrder​

Creates new or uses existing tags to add to an order.

  • To create and add a new tag to the order, do not provide an ID but do provide a unique, new title.
  • To add an existing tag to the order, either provide the tag's ID, or, provide the exact case-sensitive title.

Parameters​

NameTypeDefaultDescriptionExample
orderIdIDThe ID of the order of which to add the tags."ckmnpybisiy5x08abky4g2d1f"
tagsarrayAn array of tags. See below for accepted parameters.[{ id: "ckmnpz3isiy6x09abky5h3e2g" }, { title: "Important", color: "#69b1ff" }]
Tag​
NameTypeDefaultDescriptionExample
idID?The unique tag ID. This will be auto-generated if not provided. If provided and a tag already exists with the ID, the tag color will be updated if different."ckmnpybisiy5x08abky4g2d1f"
titlestring?A unique name which describes the tag. If a tag already exists with the title, the tag color will be updated if different."Important"
colorColor?nullThe color of the tag in the UI. Not required, but if provided, must use one of the defined hex codes, including the # prefix"#69b1ff"

Response​

A list of Tag objects which were added the order.

Example Mutation​

mutation {
addNewOrExistingTagsToOrder(
orderId: "ckmnpybisiy5x08abky4g2d1f",
tags: [ {
"title": "Important",
"color": "#69b1ff",
},
{
"id": "ckmnpybi7ag5x08abky4gdf8s"
}]
) {
id
title
type
color
}
}

Example Response​

[
{
"title": "Important",
"color": "#69b1ff",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#85a5ff",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]

removeTagFromOrder​

Removes the tag from the order.

info

The tag itself is not deleted and will not affect other resources utilizing it.

Parameters​

NameTypeDefaultDescriptionExample
orderIdIDThe ID of the order of which to remove the tag."ckmnpybisiy5x08abky4g2d1f"
tagIdIDThe ID of the tag which to remove."ckmnpz3isiy6x09abky5h3e2g"

Response​

A boolean of true if successful.

Example Mutation​

mutation {
removeTagFromOrder(orderId: "ckmnpybisiy5x08abky4g2d1f", tagId: "ckmnpz3isiy6x09abky5h3e2g")
}

Example Response​

true