There's a song called 'Mrs. McGrath,' and that's probably the same song you mean. It's about an Irishman who loses his legs on board a warship. Mrs. McGrath is his mother.
In Ireland the name McGrath is pronounced 'McGrah.' (no th sound at the end.) It's easy to see how people could think that 'McGrah' is McGraw.
I have a songbook called 'Rise Up Singing,' and the song 'Mrs. McGrath' is in it. All it says about this origin is this:
trad. (Irish)
That may be all anybody really knows, because the editors of that book seem to be quite careful about copyrights, etc.