[Feature Request] - GraphQL Query For Fetching Files Count

Hi team,
While developing an app, I discovered that the Files API does not expose any way to retrieve the total number of files in a store. Unlike resources such as products, collections, or customers, the files resource does not provide a connection‑level count field (e.g., productsCount), nor a connection that supports totalCount.

As a result, the only way to get the total number of files is to paginate through the entire files connection.
For stores with ~10,000 files this takes 20+ seconds, which is unacceptable for synchronous app flows.

Bulk operations are not a good alternative because they add unnecessary overhead for small stores and introduce latency when only a simple count is needed.

A dedicated filesCount query (similar to productsCount) or adding a connection with totalCount for files would solve this problem and significantly improve performance for apps
working with media.

Thanks for considering this enhancement.

Hey @atyaglik You’re right about the gap here. I checked the current Admin GraphQL schema, and filesCount is not available on QueryRoot, and totalCount is not available on FileConnection.

The supported path today is still the paginated files query. If your app only needs a subset, filters like media_type can help reduce the amount of pagination, but that does not solve the simple low-latency total count case you described.

I captured this internally as product feedback for a count operation on Files resources. I can’t promise a timeline, but the request and performance impact are noted. Thanks for flagging!