I just fixed this with this exact same technique, added a random comment to my api (for info the comment was #this should not have to be the solution)
And it worked. The Lambda - Appsync queries run now. How is this still a solution 10 years later?