In large environments, the function won't fetch all sites. The Graph API response contains a boolean field in hitsContainers.moreResultsAvailable indicating whether there are more results to the search or not.
In order to fix this, the function should keep increasing the "from" value of the post body (for example in 500 batches) and repeating the POST request until hitsContainers.moreResultsAvailable is false.
In large environments, the function won't fetch all sites. The Graph API response contains a boolean field in hitsContainers.moreResultsAvailable indicating whether there are more results to the search or not.
In order to fix this, the function should keep increasing the "from" value of the post body (for example in 500 batches) and repeating the POST request until hitsContainers.moreResultsAvailable is false.