Microsoft Graph documentation says the following filter expression could be utilized to list all root-level site collections:
siteCollection/root ne null
But unfortunately i have not managed to get it working against V1
endpoint.
As a workaround you could consider to filter root-level site collections on the client side, here is C# example (utilizes Microsoft Graph Client Library for .NET):
var result = new List<Microsoft.Graph.Site>();
var requestUrl = "https://graph.microsoft.com/v1.0/sites?search=*&select=webUrl,siteCollection";
var message = new HttpRequestMessage(HttpMethod.Get, requestUrl);
await graphClient.AuthenticationProvider.AuthenticateRequestAsync(message);
var response = await graphClient.HttpProvider.SendAsync(message);
var content = await response.Content.ReadAsStringAsync();
var sites = JsonConvert.DeserializeObject<List<Microsoft.Graph.Site>>(JObject.Parse(content)["value"].ToString());
result = sites.Where(s => s.SiteCollection != null).ToList();