Soak cashews: If you don’t own a high-speed blender, soak the cashews in boiled water for 20 minutes. Drain and set aside.
Preheat the oven to 400ºF if you are not using an air-fryer.
Roast tomatoes and garlic: Spray or drizzle the tomatoes and garlic with olive oil. Air-fry at 400º for about 5 minutes, or roast on a large rimmed baking sheet for 15 minutes, until the tomatoes burst.
Roast gnocchi: Spray or drizzle the frozen gnocchi with olive oil. Roast at 400ºF in the air-fryer for about 7 minutes, or until golden brown, tossing halfway. Or roast on a large rimmed baking sheet at the same time as the tomatoes for about 12 minutes, or until golden brown.
Remove the skins from the roasted garlic cloves and discard.
Make the pesto: Transfer the cashews, basil, garlic, olive oil, parmesan, and lemon juice to a blender. Add 2 tablespoons water. Blend on high until smooth, adding more olive oil or water until the desired consistency. Season with salt and pepper.
Optional: Transfer the pesto and tomatoes to a small saucepan and cook over medium-low heat, mixing the tomatoes into the pesto, until warmed through.
Serve the gnocchi with the tomatoes and pesto.