Tags
Tags are used to categorize and organize content, making it easier for users to find related items.
Schema​
Tags​
| Name | Type | Description | Example |
|---|---|---|---|
| id | ID | The unique tag ID | "ckmnpybisiy5x08abky4g2d1f" |
| title | string | A unique name which describes the tag | "Important" |
| type | TagType? | Type of resource the tag belongs to | ORDER, INVENTORY_ITEM, REQUISITION, TOOL |
| color | Color? | 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" |
| createdAt | DateTime | When this object was created | "2021-03-24 17:26:46.983Z" |
| updatedAt | DateTime | When this object was last updated | "2021-03-24 17:26:46.983Z" |
TagType​
Allowed values: ORDER, INVENTORY_ITEM, REQUISITION, TOOL
Color​
Allowed values:
| Value | Description |
|---|---|
#ff85c0 | magenta |
#ff7875 | red |
#ff9c6e | volcano |
#ffc069 | orange |
#ffd666 | gold |
#d3f261 | lime |
#95de64 | green |
#5cdbd3 | cyan |
#69b1ff | blue |
#85a5ff | geekblue |
#b37feb | purple |
#f0f0f0 | grey |
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​
| Name | Description | Example |
|---|---|---|
| orderId | The 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​
| Name | Type | Default | Description | Example |
|---|---|---|---|---|
| orderId | ID | The ID of the order of which to add the tags. | "ckmnpybisiy5x08abky4g2d1f" | |
| tags | array | An array of tags. See below for accepted parameters. | [{ id: "ckmnpz3isiy6x09abky5h3e2g" }, { title: "Important", color: "#69b1ff" }] |
Tag​
| Name | Type | Default | Description | Example |
|---|---|---|---|---|
| id | ID? | 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" | |
| title | string? | A unique name which describes the tag. If a tag already exists with the title, the tag color will be updated if different. | "Important" | |
| color | Color? | null | The 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​
| Name | Type | Default | Description | Example |
|---|---|---|---|---|
| orderId | ID | The ID of the order of which to remove the tag. | "ckmnpybisiy5x08abky4g2d1f" | |
| tagId | ID | The 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