Ordery By date/time created when fetching


I’m struggling to figure out how to order by date created when fetching.

I have a custom schema, which seems to retrieve posts by lastModified by default - ${config.API_BASE_URL}/projects

Looking at the docs, I’ve added the following to try order by date created -
${config.API_BASE_URL}/projects?$orderby=data/created/iv desc

but I’m getting 'Could not find a property named ‘created’ on type ‘Contents.Data’.

Please could somebody provide an example of how to retrieve in order of date created?

Many thanks

created is not a data field.

Just use

${config.API_BASE_URL}/projects?$orderby=created desc

1 Like

Fantastic, thanks so much for the quick reply. Works great!

1 Like