Jungle allows you to tag almost any object in the platform. Tags can be informative, and they help with sorting and filtering objects. Tags can be retrieved when retrieving an object from the API.
You can tag an object like so:
mutation TagAdd {
tagAdd(
input: {
object: { id: "xid:jungle/Product:shopify/productid/my-shop:1234", typename: "Product" }
tags: ["awesome-product"]
}
) {
... on MutationSuccess {
ok
}
... on MutationFailure {
reason
}
}
}
You can remove an object tag like so:
mutation TagRemove {
tagRemove(
input: {
object: { id: "xid:jungle/Product:shopify/productid/my-shop:1234", typename: "Product" }
tags: ["awesome-product"]
}
) {
... on MutationSuccess {
ok
}
... on MutationFailure {
reason
}
}
}
You can retrieve an object with its tags with the following query:
query GetProduct {
object(input: { id: "xid:jungle/Product:shopify/productid/my-shop:1234", typename: "Product" }) {
id
... on Product {
tags
}
}
}
Which produces a result like this:
{
"data": {
"object": {
"id": "123ABC",
"tags": ["awesome-product"]
}
}
}