Wash the chickpeas well and soak them overnight in sufficient water. Next morning pressure cook with enough water and a little salt until they are tender, but still have a bite.
Roast the onions in little oil in a skillet on medium-low heat, once the onions are translucent add grated coconut to it, roast for another minute or two until the coconut is golden brown. Remove from the pan and set aside.
In the same pan, roast the coriander seeds, on low heat, until fragrant, then add the Red chillies, peppercorns, cloves, green cardamom, star anise( remove the seeds from the petals, or else it makes the gravy bitter), mace, fennel seeds, poppy seeds and roast for another 2-3 minutes , do not burn the spices. (The poppy seeds that I have used here are different from the ones we get in India. The poppy seeds available there are white in color, so if you are using those, you need to roast them separately, put them in a pan, and cover with a lid, as those pop on getting heated and will splutter all over. After roasting, set them aside and then roast the other spices)
Grind the sautéed onion and roasted coconut along with the roasted spices to a smooth paste using little water at a time (up to 1 cup of water).
Heat oil in a deep bottomed pan, add mustard seeds, let them splutter.
Then add the prepared ground masala and mix it well with the mustard seeds and oil.
Add curry leaves, turmeric and cook the masala paste until it leaves oil and clumps together.
Add boiled chickpeas, coat them well with the masala. Rinse the grinder jar with some water to extract the remaining masala, add this to the pan, add more water as required to adjust the consistency of the gravy, Let it boil for 5 minutes on medium heat. Check for seasoning and adjust accordingly. Serve hot with some steamed rice.