When we query for a content fragment in query builder API, it returns the result as path of the image and not the actual image. In GraphQL query it returns the path however it is limited to functionalities and doesn't have sorting searching and ordering.
{ "success": true, "results": 4, "total": 4, "more": false, "offset": 0, "hits": [ { "featuredImage": "/content/dam/images/WELL_SITTING_EXERCISE_SEPT8_0.jpeg" }, { "featuredImage": "/content/dam/images/WELL_SITTING_EXERCISE_SEPT8_0.jpeg" }, { "featuredImage": "/content/dam/images/WELL_SITTING_EXERCISE_SEPT8_0.jpeg" }, {} ] }
Views
Replies
Total Likes
Using query builder API you will get only the jcr path. Could you please clarify the diff between path of the image vs actual image. You mean the nodeName of the asset in the JCR?
Actual Image meaning the `_authorUrl` or `_publishUrl` that I could use in frontend
@spidey1405 AEM Query builder API works on JCR level data, it only knows paths of the nodes with the mentioned predicates and doesnt know the final published URLs.. From what i get from you, you need fully qualified End url , which you can use it in your Front end to be used to display in your website..
Couple of things to note :-
@Shashi_Mulugu I believe queryBuilder API would also need Bearer Auth when making call like GQL API. I tried making a public call and it returned 401 unauthorized. Note that my frontend is not going to query directly to AEM, my backend is connected to AEM.
Not just URLs in case of nested Content Fragment models, I need their details as well.
So for example lets say I have a content fragment model: Event like this:
title: TextField
Venue: TextField
Dates: Date (Where Date is a content fragment)
and here's how the model of Date looks like:
Day: Number
Month: Number
Year: Number
then when I query something like this, I need the results to contain all these data points and not the reference address of the Date model.
And regarding your second point:
How can I do that? Any example or tutorial for the same?
The query builder API will give the results of events with path pointing to resource Date. In your code , you need to adapt that Date jcr path to resource and read the valueMap of that resource and return it to the front end.
Regarding full qualified URL, you can use Externalizer API to get the fully qualified URL for an jcr path and return it as part response.
Ex:
externalizer.externalLink(resourceResolver, Externalizer.PUBLISH, resourcePath)
Externalizer Doc: https://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/externalizer.html?...
@Saravanan_Dharmaraj I see... essentially what you're saying is that get the jcr:path and in order to fetch its content you need to make another api call right? Ideally I want to happen pagination/ sorting and searching within one single (either GQL or QueryBuilder call) to get all the data.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies