aws-appsync-community icon indicating copy to clipboard operation
aws-appsync-community copied to clipboard

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

Open stuartlangridge opened this issue 10 months ago • 0 comments

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"?

stuartlangridge avatar Feb 04 '25 14:02 stuartlangridge