When testing real-time subscription examples from AppSync doc, I ran into this error produced by a subscription request in AWS UI console. The references CDN with minified code which looks like AppSync's own. Enabling "logs" checkbox didn't make any difference:
error@https://<distribution hash>.cloudfront.net/<long hash>/main.js:135:942826
d@https://<distribution hash>.cloudfront.net/<long hash>/main.js:203:1070719
m@https://<distribution hash>.cloudfront.net/<long hash>/main.js:203:1071063
value@https://<distribution hash>.cloudfront.net/<long hash>/main.js:203:1072146
N</n.prototype._handleIncomingSubscriptionMessage@https://<distribution hash>.cloudfront.net/<long hash>/main.js:135:741694
My schema (simplified, hopefully it's a minimal working example):
type Post {
id: ID!
content: String
}
type Mutation {
addPost(id: ID!, content: String): Post!
}
type Subscription {
newPost: Post!
@aws_subscribe(mutations: ["addPost"])
}
schema {
mutation: Mutation
subscription: Subscription
}
I was testing the subscription by opening two AWS console windows, with AppSync Queries editor in them. The first tab would initiate the subscription and wait for data:
subscription MySubscription {
newPost {
content
id
}
}
In the second tab I would trigger a mutation, and observe the data to show up in the first tab's log:
mutation MyMutation {
addPost(id: "id1", content: "cont1") {
content
id
}
}
Note there are no explicit authentication directives in the schema, but I am using Cognito user pools in my application, so I had to login in both tabs using that method before running the subscription and mutation queries.