Is there a way to grab the total number of documents? Preferably with query options? I've searched the documentation but seem to be coming up short. Everything I see has a max page limit of 100.
A general use case would be showing a total count of the posts within a category link, or calculating the total number of pages in a paginated list of posts (e.g. page 4 of 10).
Thanks for any insights, recommendations, or links to documentation I may have missed!
You can do it using totalCount with the GraphQL API, for example to grab the total number of documents of the type “Article”:
{
allArticles {
totalCount
}
}
Another example for getting the total number of documents of the type “Article” linked to a specific “Category” document (assuming the API ID of the content relationship field to link to category documents is category):
Hello @bryan, if you use the rest API by doing a request on all documents you will see in the result object return by the API a field called total_results_size, this is the total number of documents published in your API.
I hope this helps.
Fares
closed , flag & select 'Something Else' to reopen.
5