Preheat the oven to 350 degrees. Place the squash and onion in a saucepan and add the water to a depth of 1/2-inch. Cover and cook, stirring several times, until squash is just tender. Drain well. Stir in the eggs, milk, butter, salt, and pepper and pour into a greased baking dish. Sprinkle with the cheese. Bake until set, about 25 minutes.