Boil the sweet potatoes: Peel and cube the sweet potatoes. Bring a pot of salted water to a boil, then add the sweet potatoes. Boil until they are tender when pierced with a fork, about 15-20 minutes. Drain and mash until smooth.
Make the dough: In a large bowl, combine the mashed sweet potatoes with whole wheat flour, egg yolk, salt, garlic, and black pepper. Mix until the dough starts to come together. Add more flour if necessary, but be careful not to make it too dry. The dough should be soft and slightly sticky.
Shape the gnocchi: On a lightly floured surface, roll the dough into long ropes about ½ inch thick. Cut them into 1-inch pieces. Use a fork to gently press each piece to create the traditional gnocchi indentations.
Cook the gnocchi: Bring a large pot of salted water to a boil. Add the gnocchi in batches, making sure not to overcrowd the pot. Once the gnocchi float to the surface, cook for another 1-2 minutes. Remove with a slotted spoon and set aside.
Prepare the garlic butter sauce: In a large skillet, melt butter or heat olive oil over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant. Add chili flakes and black pepper to taste. Gently toss in the cooked gnocchi and stir to coat them in the sauce.
Sauté the gnocchi: Add the cooked gnocchi to the pan, tossing gently to coat in the sauce. Cook for 3-4 minutes, allowing the gnocchi to absorb the flavors and become slightly crispy on the edges.
Finish and serve: Add fresh basil leaves and a squeeze of lemon juice for extra flavor. Serve the gnocchi with grated Parmesan cheese.