Preheat oven to 400F.
Create layers of sweet potatoes, apples, and onions in a greased 8x8 baking dish. Repeat, until all your ingredients are used, reserving a few sweet potato slices for the top layer.
Before putting on your last layer of sweet potatoes, sprinkle the top of the onions with flour, brown sugar, and cinnamon.
Top with the remaining sweet potato slices and pour the vegetable stock over the whole thing.
Cover the dish tightly with aluminum foil, and bake for 45 minutes.
Remove the dish from the oven and check to see if the potatoes are soft. If they are, return the dish to the oven, uncovered for 15 minutes, to crisp the top layer slightly.
Remove the dish from the oven and let it stand on a cooling rack for 5-10 minutes before serving, allowing it to absorb any remaining liquid.