Chop onion, garlic cloves and shallot into small pieces (separate the green part of the shallot, set it aside).
Sauté onion, garlic and shallots with olive oil at medium heat, until translucent. Add the green part of the shallot and sauté for one more minute.
Place all the ingredients in an oven-safe baking dish, except mozzarella cheese. Stir until all the ingredients are well combined.
Finally, it is your choice to either add mozzarella cheese on top for a gratin or combine it with the rest of the ingredients.
Bake the dip for 15 to 20 minutes at 400F or until the cheese starts to bubble and is fully melted.
Serve it immediately with some tortilla chips, crackers or celery sticks.