aws / aws/aws-appsync-community
Allow subscription resolvers to modify input arguments
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
This is a feature request to allow the request mapping template of subscription resolvers to modify the input arguments in terms of matching the mutations that trigger them. For example, if you had the following subscription:
`subscribeToEvent(name: String): Event`
You could add a resolver that could modify the $ctx.args set. For instance, you could set a default value for the name parameter or create an "id" parameter from the name parameter. Or you could automatically set a userId to equal $ctx.identity.sub like every other resolver can do.
Then when comparing the subscription values to the mutation, you would check the updated arguments rather than the ones initially passed in.
Contributor guide
Research direction
Start by reviewing the subscription resolver request mapping template, the $ctx.args behavior, and how subscription values are compared with triggering mutations. Confirm how existing resolvers modify arguments, then define acceptance cases for defaults, derived parameters, and identity-based userId values. Done means comparisons use the updated arguments rather than the initially supplied ones.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100