Skip to main content

Taxonomies

Often you'll want to be able to group data. You may call these kinds of groupings categories, tags, topics or something similar. For this example we'll use the tag nomenclature. Taxonomies are just another type of content.

Create a "Tag" shape.

From a "Post" shape, create a relationship to the "Tag" shape.

Add tags and select them from the relationship on a post shape entry.

Query tags

{
getTagsList {
total
items {
name
tagged {
total
items {
title
}
}
}
}
}
{
"data": {
"getTagsList": {
"total": 5,
"items": [
{
"name": "Lorem",
"tagged": {
"total": 3,
"items": [
{
"title": "Cursus Mollis Tortor"
},
{
"title": "Porta Ligula Justo Purus"
},
{
"title": "Fusce Inceptos Egestas"
}
]
}
},
{
"name": "Elit",
"tagged": {
"total": 0,
"items": []
}
},
{
"name": "Euismod",
"tagged": {
"total": 2,
"items": [
{
"title": "Cursus Mollis Tortor"
},
{
"title": "Porta Ligula Justo Purus"
}
]
}
},
{
"name": "Bibendum",
"tagged": {
"total": 1,
"items": [
{
"title": "Cursus Mollis Tortor"
}
]
}
},
{
"name": "Risus",
"tagged": {
"total": 1,
"items": [
{
"title": "Cursus Mollis Tortor"
}
]
}
}
]
}
}
}