It is narrated from Sayyiduna Abu Sa'id (may Allah be pleased with him): "The Prophet of Allah (peace and blessings be upon him) forbade sitting on graves or praying upon them."
Imam Abu Ya'la recorded this hadith in his Musnad, and all the narrators of its chain are thiqat (trustworthy) and reliable.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الجنائز / 839
Hadith Gradingمحدثین:إسناده حسن، معضل
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده حسن معضل. » «أخرجه سنن ابن ماجه برقم: 1564، وأخرجه مجمع الزوائد ومنبع الفوائد برقم: 3715، 3716، وأخرجه إتحاف الخيرة المهرة بزوائد المسانيد العشرة برقم: 2009»