There might be a more elegant way to do this, but this looks like it works:
https://graph.microsoft.com/v1.0/me/drive/root/search(q='a')?filter=folder ne null
For reference:
This uses the "filter" parameter:
https://learn.microsoft.com/en-us/graph/query-parameters#filter-parameter
"DriveItem" has a "folder" property that's only present for folders, so that just checks if "folder" ne (not-equals) null:
https://learn.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0#properties
I've not used the MS graph SDK myself but I believe your code should just be:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var search = await graphClient.Me.Drive.Root
.Search("Contoso Project")
.Request()
.Filter("folder ne null")
.GetAsync();