Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying
Do not sit on the graves and do not pray facing towards them.