Skip to main content
Sep 18, 2023 8:59 PM UTC

Graphql query to get the latest published page

Hi,

 

My use to get the latest 5 content fragments using the graph ql, I have used the jcr:lastModified in the query but its throwing the error. Pls suggest how to get the latest content fragments as per the published date.

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

4 replies

santhosh_kumark
Level 6
Sep 18, 2023 9:14 PM UTC

Hi @niharikamalireddi 

Can you share the query you are using to fetch CF based on published date.

Translate
Sep 18, 2023 9:17 PM UTC

Hi @santhosh_kumark ,

 

I didn't find any variable to get by the published date.

Translate
aanchal-sikka
Community Advisor
Community Advisor
Sep 19, 2023 2:07 AM UTC

Hello @niharikamalireddi 

 

For any date type fields, the format to be followed is

 

calendarMetadata:[CalendarMetadata]!
calendarArrayMetadata:[CalendarArrayMetadata]!

 

Ref: AEM GraphQL API for use with Content Fragments | Adobe Experience Manager

 

Related thread: Solved: GraphQL query list order by latest modified date - Adobe Experience League Community - 451110

Translate
Aanchal Sikka
kautuk_sahni
Level 9
Sep 21, 2023 7:18 AM UTC

@niharikamalireddi  Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Translate
Kautuk Sahni