Is it possible to filter content fragments by "jcr:content/metadata/cq:tags" ?
Solved! Go to Solution.
Views
Replies
Total Likes
Hope you checked this sample queries list https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...
I don't see the way to filter out based on Metadata. You can do it with the data stored in Master node as mentioned by Sachin below. Or you can use Query Builder to read that info.
You can just the output with all the tags added in Metadata in the json and filter it in the front end. That stringArrayMetadata will give the tags
_metadata { stringMetadata { name, value } stringArrayMetadata { name, value } }
Is there any reason we are looking on metadata instead of data?GraphQL works on the schema that we define in the content fragment model whereas the property you are referring is the properties of an Asset.
Whatever fields Author edits of a CF schema/model, are saved on this location : PATH_CF/jcr:content/data/master(Master CF) which can be easily filtered using below GraphQL query where category is a Tag based field.
{ sampleCFList (filter: { category: { _expressions: [{ value: "sample:category/category1" }] } }) { items { title _path } } }
To fetch CF based on tags(Asset Properties), then you can use AEM Query Builder API.
path=/content/dam type=dam:Asset property=jcr:content/metadata/@cq:tags property.value=TAG_VALUE
Hope you checked this sample queries list https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...
I don't see the way to filter out based on Metadata. You can do it with the data stored in Master node as mentioned by Sachin below. Or you can use Query Builder to read that info.
You can just the output with all the tags added in Metadata in the json and filter it in the front end. That stringArrayMetadata will give the tags
_metadata { stringMetadata { name, value } stringArrayMetadata { name, value } }
Views
Likes
Replies