Welcome to Rootschat.
I have not managed to find out much about David Graham other than there is a tree online that says his mother was Mary. However at his marriage which you can find on FreeREG it says married to Sarah Blennerhasset 13/1/1798 at Wigton Cumberland. He was 24 she was 26. Witnesses were Thomas Reed and Thomas Blacklock, and then there is a Register note that states that additional witnesses were William Blennerhasset and Mary Graham, now this could possibly be his mother meaning he was baseborn with no registered father. This is just a guess and she could be some other family member. I don't know if you want to go back on the Blennerhasset side, but if so there are trees online going back to the 1500's.
regards