amazon-cognitoaws-amplifyaws-appsyncaws-appsync-resolver

Set an authType of "User Pool Authorization" when testing a GraphQL resolver in the AppSync console


I am trying to debug authentication rules on a GraphQL API (one created by Amplify).

I can open the AWS AppSync Console and see the auth functions that Amplify has created for my Message object: the key one here is QuerygetMessageauth0Function which is a VTL resolver. I have AMAZON_COGNITO_USER_POOLS as my authenticationType for this API (and this is confirmed in settings for the API).

I can also create a test context and test the VTL resolver function directly to see what it returns when given various input parameters and authentication information.

However, when I "Run Test" to test out the vtl resolver function to see why it isn't doing what I expect, $util.authType() returns "API Key Authorization", even though the authentication for this API is set to use Cognito pools. How do I test a VTL resolver function in the AppSync console and have the $util.authType() set to "User Pool Authorization"?


Solution

  • This was the result of an AWS bug. As of today, it has been fixed.

    I filed a support request and and received a response on March 5th:

    "This is to inform you that the internal team was able to identify the issue i.e., the observed behavior was due to a recent changes done by the team to enhance the evaluate-code APIs."