Heat oil in a kadhai or a thick bottom saucepan.
Add 2 tsp mustard seeds, and when it starts to splutter add 2 tsp urad dal. Wait till urad dal slightly changes its color.
Now add chopped onion, green chilies, and curry leaves. And immediately add the chopped beans and a pinch of turmeric for a golden color. (no need of frying the onion)
Season with salt and sugar and add 1/2 cup or 1/4 cup of water. Place the lid and cook for 10 minutes on medium to low heat. (cooking time varies according to the nature of beans)
Do not overcook the beans as they need to retain the color and crunch.
Add freshly grated coconut and cook for 1 more minute.
Serve hot as a side dish.