{"action":"created","issue":{"url":"https://api.github.com/repos/graphcool/graphcool/issues/585","repository_url":"https://api.github.com/repos/graphcool/graphcool","labels_url":"https://api.github.com/repos/graphcool/graphcool/issues/585/labels{/name}","comments_url":"https://api.github.com/repos/graphcool/graphcool/issues/585/comments","events_url":"https://api.github.com/repos/graphcool/graphcool/issues/585/events","html_url":"https://github.com/graphcool/graphcool/issues/585","id":260215566,"number":585,"title":"Stream subscription events","user":{"login":"schickling","id":1567498,"avatar_url":"https://avatars2.githubusercontent.com/u/1567498?v=4","gravatar_id":"","url":"https://api.github.com/users/schickling","html_url":"https://github.com/schickling","followers_url":"https://api.github.com/users/schickling/followers","following_url":"https://api.github.com/users/schickling/following{/other_user}","gists_url":"https://api.github.com/users/schickling/gists{/gist_id}","starred_url":"https://api.github.com/users/schickling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schickling/subscriptions","organizations_url":"https://api.github.com/users/schickling/orgs","repos_url":"https://api.github.com/users/schickling/repos","events_url":"https://api.github.com/users/schickling/events{/privacy}","received_events_url":"https://api.github.com/users/schickling/received_events","type":"User","site_admin":false},"labels":[{"id":490864289,"url":"https://api.github.com/repos/graphcool/graphcool/labels/component/engine","name":"component/engine","color":"d4c5f9","default":false},{"id":702077974,"url":"https://api.github.com/repos/graphcool/graphcool/labels/component/framework","name":"component/framework","color":"d4c5f9","default":false},{"id":502077932,"url":"https://api.github.com/repos/graphcool/graphcool/labels/kind/feature","name":"kind/feature","color":"0e8a16","default":false},{"id":585695283,"url":"https://api.github.com/repos/graphcool/graphcool/labels/stage/discussing","name":"stage/discussing","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-25T09:50:57Z","updated_at":"2017-09-25T15:14:51Z","closed_at":null,"author_association":"OWNER","body":"Additionally to invoking functions via subscription events, it would be great if subscription events could be streamed directly to different event targets such as AWS Kinesis, Kafka etc.\r\n\r\nUntil this feature is directly supported via Graphcool, an easy workaround is to use functions and forward events programatically.\r\n\r\nGiven that these event targets are not necessarily functions, we should discuss how the `graphcool.yml` format should be adjusted to reflect the semantic addition. One key question is whether `functions` should stay the root-level field or if `events` would be a better fit.\r\n\r\nHere is a WIP suggestion:\r\n\r\n```yml\r\ntypes: types.graphql\r\n\r\npermissions:\r\n  - operation: \"*\"\r\n\r\nrootTokens: []\r\n\r\nfunctions:\r\n  sendConfirmEmail:\r\n    handler:\r\n      code:\r\n        src: ./src/sendConfirmEmail.js\r\n    type: subscription\r\n    query: ./src/sendConfirmEmail.graphql\r\n\r\nevents:\r\n- type: aws-kinesis\r\n  stream: my-kinesis-stream\r\n```"},"comment":{"url":"https://api.github.com/repos/graphcool/graphcool/issues/comments/331913659","html_url":"https://github.com/graphcool/graphcool/issues/585#issuecomment-331913659","issue_url":"https://api.github.com/repos/graphcool/graphcool/issues/585","id":331913659,"user":{"login":"sorenbs","id":281337,"avatar_url":"https://avatars3.githubusercontent.com/u/281337?v=4","gravatar_id":"","url":"https://api.github.com/users/sorenbs","html_url":"https://github.com/sorenbs","followers_url":"https://api.github.com/users/sorenbs/followers","following_url":"https://api.github.com/users/sorenbs/following{/other_user}","gists_url":"https://api.github.com/users/sorenbs/gists{/gist_id}","starred_url":"https://api.github.com/users/sorenbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sorenbs/subscriptions","organizations_url":"https://api.github.com/users/sorenbs/orgs","repos_url":"https://api.github.com/users/sorenbs/repos","events_url":"https://api.github.com/users/sorenbs/events{/privacy}","received_events_url":"https://api.github.com/users/sorenbs/received_events","type":"User","site_admin":false},"created_at":"2017-09-25T15:14:51Z","updated_at":"2017-09-25T15:14:51Z","author_association":"OWNER","body":"We have decided to remove the top-level `functions` field. See #591\r\n\r\nIf sendConfirmEmail is a subscription that should put an item on a kinesis queue it should look like this:\r\n\r\n```yml\r\nsubscriptions:\r\n  sendConfirmEmail:\r\n    handler:\r\n      kinesis:\r\n        stream: my-kinesis-stream\r\n    query: ./src/sendConfirmEmail.graphql\r\n```\r\n"}}
{"actor":{"display_login":"sorenbs"}}