Expand my Community achievements bar.

SOLVED

GraphQL Query for UUID in AEM 6.5

Avatar

Level 2

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

 

 

1 Accepted Solution

Avatar

Correct answer by
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

View solution in original post

5 Replies

Avatar

Correct answer by
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.


Avatar

Administrator

@Divya_T13 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni