Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

GraphQL Query for UUID in AEM 6.5

Avatar

Level 1

Hi,

 

How to retrieve jcr:uuid from a Content Fragment base path in a Graph QL query. We are using AEM 6.5 with service pack 6.5.17.

 

Thanks,

Divya

 

 

4 Replies

Avatar

Community Advisor

Hi @Divya_T13 ,

Seems we are not able to access jcr:uuid with GraphQL

We may try to generate unique id as workaround https://www.linkedin.com/pulse/custom-datatype-content-fragments-model-cfm-aem-generate-ankur-garg/

Not sure if it satisfy yours use case.

Thanks

Avatar

Level 5

Hi @Divya_T13 ,

 

AEM GraphQL is querying the data exposed by Content Fragment models and CF models is not exposing the jcr:uuid directly. In Order to do we need to modify the CF model implementation and the specific property like jcr:uuid so that it will be available and GraphQL can use it . 

~Bhausaheb

 

Avatar

Community Advisor

If it is not a strict requirement then you can possibly use _path parameter as unique identifier in your queries. It will return the CF path which should be unique in each case.
In case variations are involved then consuming application can use both _path and  _variation param to create a unique identifier. 
Hope this helps.