For the cheese spaetzle, mix the flour, water, eggs and salt and let stand for 10 minutes.
Bring water to a boil in a pot and add salt. Press the dough through a sieve into the boiling water, boil briefly, strain, rinse and toss in butter.
Preheat oven slightly. Grease baking dish and grate cheese. Layer spaetzle alternately with cheese in baking dish. Peel and chop onion and fry in butter.
Sprinkle cheese spaetzle with onion and warm through in the oven so that the cheese melts.