Seeking Blessings from Graves
Question:
Is it permissible to stand or sit by a grave for supplication in favor of the deceased?
Answer:
The purpose of the legitimate visitation to graves is to get a lesson, remember death and heed, not for seeking blessings from the buried. When one enters a cemetery, he should greet the dead saying:
"As-Salamu Alaikum, O people of this place, believers and Muslims, and we will if Allah wills - follow you. We ask Allah safety for ourselves and yourselves.
One may also recite other supplication in favor of the dead that are recommended by the Prophet. But he should not ask the dead people to fulfill his needs, seek relief or benefit from them.
Supplication is an act of worship which must be dedicated to Allah alone. There is no harm, however, in standing or sitting by the grave while supplicating, but not for seeking blessings or taking rest. Graveyards are not resting places or residential areas for people to sit in. It is legitimate to stand by the grave right after burial to supplicate in favor of the buried asking Allah to confirm him and forgive him. It is authentically reported that whenever the Prophet buried a dead, he would stand by his grave and say:
"Ask Allah's forgiveness for your brother, and ask Him to make him give firm answers, for right now he is being questioned".
Source:
Fatawa Islamiyah, Vol. 1 Pages 66-67