!For the Gnocchi:
In a mixing bowl, add egg to ricotta and stir to combine. To that, add 1c of flour and pinch of salt. Fold flour in gently until a soft dough forms. If dough is sticky, add more of the reserved flour by the tablespoon until it is no longer sticky. Do not knead or over mix the dough (this will result in chewy gnocchi).
Turn dough out onto a floured surface and pinch off baseball-sized portions of dough. Using both hands in a back-and-forth motion, roll dough into a long snake, about 1/2 to 3/4 inch thick. (the size of the dumplings doesn't matter as much as that they are uniform with one another so they cook evenly)
Take a sharp knife and cut the snake into 1-inch pieces. Repeat rolling and cutting steps with the rest of the dough.
Place a large pot of water on the stove over high heat. Salt generously and bring to a boil.
At this point, you can press your gnocchi down the tines of a fork or on a wood gnocchi board to achieve the groove marks. Or you can skip this step (some say the grooves help hold the sauce).
When water is boiling steadily, carefully drop gnocchi in. Grab a large slotted spoon and don't walk away. As soon as the gnocchi float to the top, they are done (if you overcook them, they will turn into mush. Remove them promptly). As they float to the top, you can easily remove them with a slotted spoon, shaking off excess water, and put them straight into the pan of sauce.
!For the sauce:
In a large frying pan, heat olive oil over medium heat. Add garlic and pepper flakes, stirring, one minute, or until fragrant but without browning the garlic. Add tomato sauce to the pan, followed by sugar and salt. Turn heat to medium-low and allow to simmer while the gnocchi are cooking.
Add cooked gnocchi directly to sauce, stirring to coat, and remove from heat. Toss in fresh mozzarella and basil. Stir gently to combine (the mozzarella will begin to melt, so don't stir much). Serve immediately.