In the Name of Allah, Most Merciful and Compassionate
It is prohibitively disliked (but valid) to perform the ritual prayer [salah] in a graveyard in the immediate vicinity of the graves themselves, especially if it is in front of one within eyeshot as one looks downward in prayer.
However, if there is an area beside it empty of graves, or something that indicates it is not an actual place of graves, it would be permissible to pray there. Many graveyards in the Muslim world have a separate tract of land or a shed adjacent to the graves to perform the prayer, for example, or a graveyard may have a paved area or vacant grass nearby. [Tahtawi, Hashiya ‘ala Maraqi al-Falah]
Wassalam,
[Shaykh] Abdullah Anik Misra
Checked and Approved by Shaykh Abdul-Rahim Reasat
Shaykh Abdullah Misra was born in Toronto, Canada, in 1983. His family hails from India, and he was raised in the Hindu tradition. He embraced Islam in 2001 while at the University of Toronto, from where he completed a Bachelor of Business Administration.
He then traveled overseas in 2005 to study the Arabic language and Islamic sciences in Tarim, Yemen, for some time, as well as Darul Uloom in Trinidad, West Indies. He spent 12 years in Amman, Jordan, where he focused on Islamic Law,
Theology, Hadith Sciences, Prophetic Biography, and Islamic Spirituality while also working at the Qasid Arabic Institute as Director of Programs. He holds a BA in Islamic Studies (Alimiyya, Darul Uloom) and authorization in the six authentic books of Hadith and is currently pursuing specialized training in issuing Islamic legal verdicts (ifta’)