You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
I'm facing this same issue with a vanilla schema + DynamoDB data source + Cognito User Pool authentication. I leave the default schema on a new API untouched and add a JavaScript resolver to one of my subscriptions (while adding the necessary @aws_cognito_user_pools annotation to the necessary schema types). I get the same Runtime Error when trying to test the subscription in the console. The same error occurs whether with the generated Resolver JS code from the console or when I replace it with the example code outlined in the documentation:
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
What am i doing wrong? The logs are not showing any errors either :/
The text was updated successfully, but these errors were encountered: