The question looks like drmatic irony to bring three situation you put forward such as, grave yard, midnight, and alone to react., the attention simply drag me to a tag question why? to whom to react for what there?

Grave yard is for the dead and live people may pray for them and it may reach to them.
It is all the same affect in there for the dead wheather the morning or midnight the life they are experiencing after death depends on the deeds and their passcore in the life during their presence with us and they can do nothing for you if u are there in the midnight good or bad.. they disappeared with their result to the God who created them to the world in between the day of resurrection and judgement if u are a believer in scriptures., so to wish them with peace and mention them also we are also coming behind to join with them is optional salutation in islam., that makes you remind of your death too to prepare for yourself to be a successful man in the life after by adopting a moral lifestyle which is accepted by God who reward for all depends on the faith and clean deeds dedicated to God without any impure intentions.

Science cannot answer to the phenomenon completely about the dead and their life after whatsoever except the relegion only. Therefore, people beleiving in different reletion has their own faith related to the dead and what they have to do for them after the death of their beloved.

Muslims believe that there is no death but a transfer of the residence is being taken place because the soul is a foreign body planted at fourth month of baby for a given period of trial life in this world for human being and death take places asper will and wish of the gold from the place where it is decreed in the destiny of every person who comes in the earth. There is no book in the world ever written authentically and followed 100% related to life after death available except Holy Quran.
You just try to go thru it taking ablution and clear intention to enrich your knowledge to react or act according to what do you look for is transparently and evidently well explained in this doctrin as a guidance and to prepare for the future to be a successful person here after life. Wish you Good luck.