Pour olive oil into a sauté pan and set over medium heat. Add onion and cook until softened, 5-8 minutes. Add garlic and cook 30 seconds more, until fragrant.
Sprinkle on flour and stir well to coat. It should look pasty. Add the green chiles and stir in the vegetable stock, scraping the bottom of the pot to release any stuck bits. Stir in salt.
Bring to a low boil, then reduce heat and simmer until thickened, about 15 minutes.
Use an immersion blender or transfer to a regular blender and blend until smooth, or desired consistency is achieved.
Use immediately or pour into containers and loosely place lid. Let cool to room temperature, then transfer to the refrigerator.
Notes
Makes about 4 cups.
To roast chiles, place on a baking sheet and roast at 400°F for about 40 minutes, flipping halfway. Place in bowl and cover to steam. Peel off skins and chop.