Do not pray facing towards the graves, and do not sit on them.

Sahih Muslim Book 11 Hadith 127

Sahih Muslim #972 b

The Book of Prayer - Funerals 11:127

Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying:

Do not pray facing towards the graves, and do not sit on them.

Chapter: Prohibition against sitting and praying on graves

Grade: Sahih