aws / aws/aws-appsync-community
Set an authType of "User Pool Authorization" when testing a GraphQL resolver in the AppSync console
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
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"?
Contributor guide
Research direction
Start in the AWS AppSync Console with the `QuerygetMessageauth0Function` VTL resolver and its test context. Reproduce the Run Test behavior, inspect how the authentication information is supplied, and verify that `$util.authType()` reports `User Pool Authorization` when the API uses `AMAZON_COGNITO_USER_POOLS`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, graphql
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100