What Type of Worms are in Wormy Apples?

The worms inside of apples are called railroad worms. They come from small fruit flies called apple maggot flies. The female maggot fly pokes a hole in the apple and lays her eggs inside. The eggs then hatch into the worms. Yuck!