GET most recent "n" results

Can someone point me to the API docs that reference getting the latest “number” results of a particular type?

For example, I would like to get the most recent “n” results of a content type that is being created.

1 Like

Hey Tom,

I’ll be happy to help, but I just want to be sure what you mean. You want to for example do something like “Get the latest 12 blog posts”? Also what technology are you using?


Thank you Phil for the quick response. I appreciate it.
And yes, exactly. “Get the latest 12 blog posts” would be perfect.

We are using Node and GraphQL.

OK in that case you would use a combination of the SortBy (to get the latest)and first (to get less than 20 docs) arguments in your query to make a query like:

  allBlog_posts(sortBy:meta_firstPublicationDate_DESC, first:12){

You can read more about sortBy here:

Also the first argument here:

Reading about pagination in Prismic’s GraphQL api might help too:


Perfect. Thank you. I appreciate it.

1 Like