There have been many studies about the nutrition of vegetables, both raw and cooked, as well as how different methods of cooking fare, nutrition-wise. The results are a mixed bag. Water-soluble nutrients don’t take well to heat, vitamin C and B vitamins in particular. On the other hand, cooking breaks down the thick cell walls of vegetables like tomatoes, carrots, asparagus, broccoli, cabbage, and mushrooms, making some nutrients and compounds — especially the antioxidants lycopene and carotenoids — more available for absorption. But it’s not that simple: Studies have shown that in some produce, cooking compromises certain compounds thought to fight precancerous cells, while other studies have found that in different produce, heat can create compounds that fight precancerous cells. Finally, there is no consensus regarding which cooking methods are most effective for nutrient retention — some studies say boiling and pressure cooking are the best and others say exactly the opposite — though most agree that frying creates dangerous free radicals.
My recommendation is simply to eat both raw and cooked vegetables, and to cook them in the ways you like best, so you’ll enjoy them and eat more of them.