Graphql query to get the latest published page | Community
Skip to main content
September 18, 2023

Graphql query to get the latest published page

  • September 18, 2023
  • 3 replies
  • 1416 views

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.

3 replies

santhosh_kumark
Level 6
September 18, 2023

Hi @niharikamalireddi 

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

September 18, 2023

Hi @santhosh_kumark ,

 

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

aanchal-sikka
Community Advisor
Community Advisor
September 19, 2023

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

Aanchal Sikka
kautuk_sahni
Community Manager
Community Manager
September 21, 2023

@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.

Kautuk Sahni