Videos
You can't get all products with a single GraphQL request either with the StoreFront GraphQL or the Admin GraphQL.
If your products are below 250 you can make a request with first: 250 but if you have more than 250 products than you need to make recursive request with the cursor pagination for GraphQL. So if you have 1000 products you will need to make 4 request (depending on which API you are using, the storefront or admin graphql api, since they are different)
At the moment there is no way to get all products using a single request via any of the provided APIs from Shopify.
The only way to achieve this is to make a custom template with the following code:
[
{% paginate collection.products by 9999 %}
{% for product in collection.products %}
{{product | json}}{% unless forloop.last %},{% endunless %}
{% endfor %}
{% endpagination %}
]
Call it something like collection.ajax.liquid.
And make a fetch request to it using the view param:
fetch('/collections/all?view=ajax').then((response) => handle the response)
Have in mind that the more products you have the longer the request to that page will be. If you have 1000 products the request can take up to 10 seconds. So this is not a great solution as well for massive pool of products.
As for the total count there is a liquid object for that {{ collection.all_products_count }} or if you are doing admin stuff, use the rest api, since there is a method to get the products count, but there is none in the graphql.
You can get all products using BULK API with conjunction to GRAPHQL