Prepare a spaetzle dough from flour, eggs, oil, salt and milk, and immediately spread it through a spaetzle strainer into boiling salted water. Cook for 5 minutes, then strain.
Finely chop the onion and roast in butter with the crushed garlic clove. Add the ham cut into small pieces and pour in the vegetable stock. Stir in the herb mixture and cream and season to taste.
Mix the sauce and half of the cheese with the spaetzle well and pour into a greased casserole dish, sprinkle with the remaining cheese and bake in a hot oven at 200 ° C for about 20 minutes.