aws / aws/aws-appsync-community
custom subscription resolver: connection failed, runtime error
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
What i'm trying to achieve: custom javascript resolver for a subscription.
I understand that when you use appsync and create a type for e.g.
`type chatMessage {
channel: String!
userId: String!
text: String!
id: ID!
}`
appsync will automatically generate queries, mutations and subscriptions for you. And they work, even though the auto-generated subscriptions all don't seem to have a resolver. Why is that so?
When i try to attach a custom javascript resolver on `onCreateChatMessage`, it failed with
`"Connection failed: {\"errors\":[{\"errorType\":\"Code\",\"message\":\"Runtime Error\"}]}"`.
I tried creating a new subscription, and attached the resolver to it, but it failed too.
The resolver i added was based on the [appsync doc ](https://docs.aws.amazon.com/appsync/latest/devguide/aws-appsync-real-time-enhanced-filtering.html#aws-appsync-real-time-enhanced-filtering-defining-filters)
What am i doing wrong? The logs are not showing any errors either :/
Contributor guide
Research direction
Start with the custom JavaScript resolver attached to onCreateChatMessage and compare it with the AWS AppSync enhanced-filtering example linked in the issue. Reproduce the connection failure, inspect the resolver and runtime logs, and confirm the subscription connects without a Runtime Error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100