The Messenger of Allah (ﷺ) as saying: Do not sit on the graves, and do not pray facing them.
Sunan Abi Dawud Book 21, Hadith 141