How can I get the name of the tag (jcr:title) from GraphQL in the Content Fragment Model? | Community
Skip to main content
Level 2
October 6, 2022
Solved

How can I get the name of the tag (jcr:title) from GraphQL in the Content Fragment Model?

  • October 6, 2022
  • 1 reply
  • 1221 views

When I use the DataType of Tags in the Content Fragment Model and reference it from GraphQL, it returns the tag path (e.g. my-sites:tag-layer1/tag-layer2).
How can I get the name of the tag (jcr:title) from GraphQL in addition to the tag path?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Saravanan_Dharmaraj

I don't think you can get the title of tag in Graph QL since the iD of the tags are stored in array. You are just querying the schema values in Graph QL.

Query Builder API has the flexibility to read the same IDs and use the tagManager API to get the tag and read its title.

 

1 reply

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
October 10, 2022

I don't think you can get the title of tag in Graph QL since the iD of the tags are stored in array. You are just querying the schema values in Graph QL.

Query Builder API has the flexibility to read the same IDs and use the tagManager API to get the tag and read its title.

 

satoshi1Author
Level 2
October 14, 2022

I understand that I cannot get the title of the Tag in GraphQL.

It seems that the Query Builder API can do it, but I wanted to develop it on the front end, not on the back end.

I will consider other methods including the Query Builder API, thank you.