AEM 6.5 | Graphql query to fetch Tags
In my custom react application, I wanted to fetch and show one of the Tag values. Wondering if I can do it using Graphql query.
In my custom react application, I wanted to fetch and show one of the Tag values. Wondering if I can do it using Graphql query.
@mukesh_kumar_co
If tags are stored on Content Fragment itself, then it can be achieved via following:
query {
cityList(
filter: {_tags: {_expressions: [{value: "tourism:city-break", _operator: CONTAINS}]}}
){
items {
name,
_tags
}
}
}
Or
If these tages are on Content Fragment Metadata, then it can be achieved, via:
{
adventureList {
items {
_path,
_metadata {
stringArrayMetadata {
name,
value
}
}
}
}
}
You will get all the metadata properties with String Array as Data Type, including cq:tags
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.