Begin by preheating your oven to 375°F (190°C). This ensures that your oven is hot and ready to bake your dish once it's assembled.
In a large pot of boiling salted water, cook the gnocchi according to the package instructions until they float to the surface, usually about 2-3 minutes. Once cooked, drain the gnocchi and set them aside.
In a separate pan, heat olive oil over medium heat. Add finely chopped onions, carrots, and celery, and sauté until they are softened and lightly caramelized, about 5-7 minutes. Then add minced garlic and cook for an additional minute until fragrant.
Once the bolognese sauce is ready, mix it with the cooked gnocchi until they are evenly coated. You can do this directly in the pot or a large mixing bowl.
Grease a baking dish with butter or cooking spray. Transfer the gnocchi and bolognese mixture into the baking dish, spreading it out evenly.
Sprinkle shredded mozzarella cheese and grated Parmesan cheese over the top of the gnocchi and bolognese mixture. The cheese adds a delicious gooeyness and flavor to the dish.
Place the baking dish in the preheated oven and bake for about 20-25 minutes, or until the cheese is melted and bubbly, and the edges of the gnocchi are slightly crispy.
Once baked, remove the dish from the oven and let it cool for a few minutes before serving. Garnish with fresh basil leaves or parsley if desired, and enjoy your delicious baked gnocchi bolognese!