For that very reason the scholars took him to task. After citing al-Bayḍāwī’s words, al-Manāwī remarked:
“Yet in the report given by the two Ṣaḥīḥs there is an unconditional disapproval of building a mosque upon graves—meaning the graves of Muslims—for fear that the graves themselves might come to be worshipped, as indicated by the ḥadith: ‘O Allah, do not let my grave become an idol that is worshipped.’ ”
Imām Muḥammad, the disciple of Abū Ḥanīfah, explicitly stated that it is disliked to establish a mosque ‘near’ a grave, as his own wording—soon to be quoted—makes clear. The term ‘near’ (ʿinda) is broader than ‘above’ (fawq) or ‘on top of’ (ʿalā), which is obvious; accordingly, whoever erects a mosque beside a righteous person has built it ‘near’ him. Thus Muḥammad’s statement refutes al-Bayḍāwī’s innovative view, a point likewise made by al-Ṣanʿānī in Subul al-Salām, where he said:
“Concerning the claim ‘…not out of veneration for him,’ we reply: building mosques in his vicinity and seeking blessing through him is itself veneration. The ḥadiths that prohibit this are unqualified, and there is no evidence for the rationale he proposed. The obvious rationale is to block the means and to avoid resembling the idol-worshippers who glorify lifeless objects that can neither benefit nor harm, and because spending wealth on such structures is sheer frivolity and waste that brings no benefit whatsoever.”
He further stated, “The harms that flow from the shrines and domes erected over graves are beyond reckoning.”
The first ḥadith, then, establishes the prohibition of praying in a graveyard, in the detailed manner already noted, both because of its general wording and because a prohibition by default signifies unlawfulness. Some scholars have gone so far as to rule the prayer invalid in such a place—an opinion that is arguable, and Allah knows best. Ibn Ḥazm adopted this view in al-Muḥallā, and he transmitted that Aḥmad said so as well.