Melt the butter. Dust with flour and briefly sauté lightly. Add 1/4 l water and milk while stirring. Bring to the boil, simmer for about 5 minutes. Grate cheese, melt about 2/3 in the sauce. Season to taste with salt and pepper.
Preheat oven (electric cooker: 200°C/circulating air: 175°C/gas: level 3). Cut ham into strips. Stir the gnocchi into the sauce and fill into an ovenproof dish.
Sprinkle the remaining cheese over the casserole. Bake in a hot oven for about 15 minutes. Wash the chives, shake dry, cut into small rolls and sprinkle over the casserole.