At least one pedigree published by FamilySearch claims that William Graham was the son of David Graham, Viscount Dundee, and a wife named Marion Bell.
Family Search: David Graham
https://ancestors.familysearch.org/en/K8FX-13T/david-graham-9th-lai...
This is followed or copied by at least one pedigree published by MyHeritage
MyHeritage: William Graham
https://www.myheritage.com/matchingresult-37d6544d28989fc4e7dd163ee...
This claim is wrong and for the following reasons. (1) David Graham, third Viscount Dundee died unmarried and childless in 1700. (2) Marion Bell, who it is claimed was the wife of the third Viscount Dundee, was in fact the wife of David Graham, resident of Hawick in Roxburghshire.
Unless there are objections I propose to disconnect William Graham from David Graham, third Viscount Dundee.
David Graham, 3rd Viscount Dundee
David Graham, Resident of Hawick