{"action":"created","issue":{"url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2012","repository_url":"https://api.github.com/repos/aws-amplify/amplify-js","labels_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2012/labels{/name}","comments_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2012/comments","events_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2012/events","html_url":"https://github.com/aws-amplify/amplify-js/issues/2012","id":375525691,"node_id":"MDU6SXNzdWUzNzU1MjU2OTE=","number":2012,"title":"AppSync Subscriptions not working","user":{"login":"krazykhris875","id":14822819,"node_id":"MDQ6VXNlcjE0ODIyODE5","avatar_url":"https://avatars1.githubusercontent.com/u/14822819?v=4","gravatar_id":"","url":"https://api.github.com/users/krazykhris875","html_url":"https://github.com/krazykhris875","followers_url":"https://api.github.com/users/krazykhris875/followers","following_url":"https://api.github.com/users/krazykhris875/following{/other_user}","gists_url":"https://api.github.com/users/krazykhris875/gists{/gist_id}","starred_url":"https://api.github.com/users/krazykhris875/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krazykhris875/subscriptions","organizations_url":"https://api.github.com/users/krazykhris875/orgs","repos_url":"https://api.github.com/users/krazykhris875/repos","events_url":"https://api.github.com/users/krazykhris875/events{/privacy}","received_events_url":"https://api.github.com/users/krazykhris875/received_events","type":"User","site_admin":false},"labels":[{"id":845261176,"node_id":"MDU6TGFiZWw4NDUyNjExNzY=","url":"https://api.github.com/repos/aws-amplify/amplify-js/labels/API","name":"API","color":"35e006","default":false},{"id":772607811,"node_id":"MDU6TGFiZWw3NzI2MDc4MTE=","url":"https://api.github.com/repos/aws-amplify/amplify-js/labels/documentation","name":"documentation","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-10-30T14:42:14Z","updated_at":"2018-10-30T16:56:32Z","closed_at":null,"author_association":"NONE","body":"**Do you want to request a feature or report a bug?**\r\nBug\r\n\r\n**What is the current behavior?**\r\nSimply cannot get AppSync Subscriptions to work. I've confirmed that the subscription works in the AWS console (by opening the query page in two windows, running the subscription in one, and queries in the other), however I cannot get it to work in my application.\r\n\r\nCode subscription: \r\n\r\n```\r\n    const sub = API.graphql(graphqlOperation(subscriptions.onCreateLog)) as Observable<object>;\r\n    sub.subscribe({\r\n      next: (value: object) => {\r\n        console.log(JSON.stringify(value));\r\n      },\r\n      error: (error: any) => {\r\n        console.log(JSON.stringify(error));\r\n      }\r\n    });\r\n```\r\n\r\nThe syntax for subscriptions in the docs, which doesn't involve \"as Observable<object>,\" doesn't work for me. \r\n\r\nPer issue https://github.com/aws-amplify/amplify-js/issues/660, you must put your AppSync configuration at the root of your configuration, not under the API section. This lines up with the documentation. When I do this, however, I get: \r\n\r\n`{\"data\":{},\"errors\":[{\"message\":\"No graphql endpoint provided.\"}]}`\r\n\r\nPer issue https://github.com/aws-amplify/amplify-js/issues/1302, this can be resolved by putting the appsync configuration in the API section of your configuration... In direct contradiction of https://github.com/aws-amplify/amplify-js/issues/660. This resolves the No graphql endpoint error, but still, my subscription doesn't seem to work. I've tried putting the AppSync information both at the root of the config object and in the API section, however this doesn't work either. \r\n\r\nI'm at a bit of a loss, here. I've been at this for for quite awhile now, between this and the code in the docs not working. \r\n\r\nHere is my network panel, if that helps\r\n\r\n![image](https://user-images.githubusercontent.com/14822819/47726147-a76cba00-dc38-11e8-9be2-1ffbf386c71b.png)\r\n\r\n**What is the expected behavior?**\r\nSubscriptions should receive data changes from mutations.\r\n\r\n**Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?**\r\nVersion: aws-amplify@1.1.6\r\nBrowser: Chrome\r\nOS: Windows 10"},"comment":{"url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/comments/434383692","html_url":"https://github.com/aws-amplify/amplify-js/issues/2012#issuecomment-434383692","issue_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2012","id":434383692,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDM4MzY5Mg==","user":{"login":"krazykhris875","id":14822819,"node_id":"MDQ6VXNlcjE0ODIyODE5","avatar_url":"https://avatars1.githubusercontent.com/u/14822819?v=4","gravatar_id":"","url":"https://api.github.com/users/krazykhris875","html_url":"https://github.com/krazykhris875","followers_url":"https://api.github.com/users/krazykhris875/followers","following_url":"https://api.github.com/users/krazykhris875/following{/other_user}","gists_url":"https://api.github.com/users/krazykhris875/gists{/gist_id}","starred_url":"https://api.github.com/users/krazykhris875/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krazykhris875/subscriptions","organizations_url":"https://api.github.com/users/krazykhris875/orgs","repos_url":"https://api.github.com/users/krazykhris875/repos","events_url":"https://api.github.com/users/krazykhris875/events{/privacy}","received_events_url":"https://api.github.com/users/krazykhris875/received_events","type":"User","site_admin":false},"created_at":"2018-10-30T16:56:32Z","updated_at":"2018-10-30T16:56:32Z","author_association":"NONE","body":"@mlabieniec CLI v6.2.6\r\n\r\nI'll try the mutation"}}
{"actor":{"display_login":"krazykhris875"}}