The Book of Prayer - Funerals
وَحَدَّثَنِي عَلِيُّ بْنُ حُجْرٍ السَّعْدِيُّ، حَدَّثَنَا الْوَلِيدُ بْنُ مُسْلِمٍ، عَنِ ابْنِ جَابِرٍ، عَنْ بُسْرِ، بْنِ عُبَيْدِ اللَّهِ عَنْ وَاثِلَةَ، عَنْ أَبِي مَرْثَدٍ الْغَنَوِيِّ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " لاَ تَجْلِسُوا عَلَى الْقُبُورِ وَلاَ تُصَلُّوا إِلَيْهَا " .Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying:Do not sit on the graves and do not pray facing towards them
From Sahih Muslim, whose reports the scholars accept as authentic.