Chop walnuts, cut the apple into small, thin pieces, cut the onion into rings, grate the cheese.
Heat the spaetzle with a little butter in an ovenproof saucepan. Heat the cream at the same time, let half of the cheese melt in the cream. Season to taste with salt and pepper. Roast the onion rings in a pan. Briefly heat the apple and walnut pieces in a pan with a little butter.
Pour the cream cheese sauce over the spaetzle, mix well over a medium temperature. Add the rest of the cheese and let it melt. Finally add apple and walnut pieces and, if necessary, briefly put in the preheated oven. Season with salt and pepper, spread the onions over the spaetzle and serve.