{"action":"created","comment":{"url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/comments/223450584","pull_request_review_id":162580858,"id":223450584,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzQ1MDU4NA==","diff_hunk":"@@ -13,16 +16,38 @@ makeSchema().then((schema) => {\n   const server = new ApolloServer({\n     schema,\n     context,\n-    playground: config.PLAYGROUND_ENABLED,\n+    playground: config.PLAYGROUND_ENABLED && {\n+      subscriptionEndpoint: '/subscriptions',\n+    },\n   })\n \n   const app = new Koa()\n \n   app.use(logger)\n   server.applyMiddleware({ app })\n \n-  app.listen(\n-    { port: config.PORT },\n-    () => console.log(`Server listening at http://localhost:${config.PORT}`), // tslint:disable-line no-console\n-  )\n+  const ws = createServer(app.callback())\n+\n+  ws.listen(config.PORT, () => {\n+    console.log(`Server listening at http://localhost:${config.PORT}`) // tslint:disable-line no-console\n+    new SubscriptionServer( // tslint:disable-line no-unused-expression\n+      {\n+        execute,\n+        subscribe,\n+        schema,\n+        onConnect: (connectionParams: any) => {\n+          const token = connectionParams.Authorization\n+          return {\n+            getToken: () => {\n+              if (!token) {","path":"src/index.ts","position":46,"original_position":46,"commit_id":"44f9a4466ec7a33120f902e3a5e8e39d8dad89f4","original_commit_id":"44f9a4466ec7a33120f902e3a5e8e39d8dad89f4","user":{"login":"hedvigoscar","id":39644124,"node_id":"MDQ6VXNlcjM5NjQ0MTI0","avatar_url":"https://avatars3.githubusercontent.com/u/39644124?v=4","gravatar_id":"","url":"https://api.github.com/users/hedvigoscar","html_url":"https://github.com/hedvigoscar","followers_url":"https://api.github.com/users/hedvigoscar/followers","following_url":"https://api.github.com/users/hedvigoscar/following{/other_user}","gists_url":"https://api.github.com/users/hedvigoscar/gists{/gist_id}","starred_url":"https://api.github.com/users/hedvigoscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hedvigoscar/subscriptions","organizations_url":"https://api.github.com/users/hedvigoscar/orgs","repos_url":"https://api.github.com/users/hedvigoscar/repos","events_url":"https://api.github.com/users/hedvigoscar/events{/privacy}","received_events_url":"https://api.github.com/users/hedvigoscar/received_events","type":"User","site_admin":false},"body":"We can if we want. We can also let `api-gateway` do that for us for now :wink:","created_at":"2018-10-08T18:00:49Z","updated_at":"2018-10-08T18:00:50Z","html_url":"https://github.com/HedvigInsurance/giraffe/pull/4#discussion_r223450584","pull_request_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/comments/223450584"},"html":{"href":"https://github.com/HedvigInsurance/giraffe/pull/4#discussion_r223450584"},"pull_request":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4"}},"in_reply_to_id":223361955},"pull_request":{"url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4","id":221053287,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxMDUzMjg3","html_url":"https://github.com/HedvigInsurance/giraffe/pull/4","diff_url":"https://github.com/HedvigInsurance/giraffe/pull/4.diff","patch_url":"https://github.com/HedvigInsurance/giraffe/pull/4.patch","issue_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/4","number":4,"state":"open","locked":false,"title":"Create Offer Mutation","user":{"login":"hedvigoscar","id":39644124,"node_id":"MDQ6VXNlcjM5NjQ0MTI0","avatar_url":"https://avatars3.githubusercontent.com/u/39644124?v=4","gravatar_id":"","url":"https://api.github.com/users/hedvigoscar","html_url":"https://github.com/hedvigoscar","followers_url":"https://api.github.com/users/hedvigoscar/followers","following_url":"https://api.github.com/users/hedvigoscar/following{/other_user}","gists_url":"https://api.github.com/users/hedvigoscar/gists{/gist_id}","starred_url":"https://api.github.com/users/hedvigoscar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hedvigoscar/subscriptions","organizations_url":"https://api.github.com/users/hedvigoscar/orgs","repos_url":"https://api.github.com/users/hedvigoscar/repos","events_url":"https://api.github.com/users/hedvigoscar/events{/privacy}","received_events_url":"https://api.github.com/users/hedvigoscar/received_events","type":"User","site_admin":false},"body":"This PR grew a little bit out of hand, sorry 😞 \r\n\r\nIt basically contains:\r\n\r\n- Create Offer Mutation\r\n- Session management mutations\r\n- Redis infrastructure\r\n- Schema type generation infrastructure\r\n\r\nIf you think it's unmanageable in size I can split it down - just say the word :+1:","created_at":"2018-10-08T09:34:13Z","updated_at":"2018-10-08T18:00:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7d5b4b23f1c922acb21126dfaeb4dbbb4820f9b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Iamsamwhoami","id":5459507,"node_id":"MDQ6VXNlcjU0NTk1MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/5459507?v=4","gravatar_id":"","url":"https://api.github.com/users/Iamsamwhoami","html_url":"https://github.com/Iamsamwhoami","followers_url":"https://api.github.com/users/Iamsamwhoami/followers","following_url":"https://api.github.com/users/Iamsamwhoami/following{/other_user}","gists_url":"https://api.github.com/users/Iamsamwhoami/gists{/gist_id}","starred_url":"https://api.github.com/users/Iamsamwhoami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Iamsamwhoami/subscriptions","organizations_url":"https://api.github.com/users/Iamsamwhoami/orgs","repos_url":"https://api.github.com/users/Iamsamwhoami/repos","events_url":"https://api.github.com/users/Iamsamwhoami/events{/privacy}","received_events_url":"https://api.github.com/users/Iamsamwhoami/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4/commits","review_comments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4/comments","review_comment_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/4/comments","statuses_url":"https://api.github.com/repos/HedvigInsurance/giraffe/statuses/44f9a4466ec7a33120f902e3a5e8e39d8dad89f4","head":{"label":"HedvigInsurance:feature/create-offer-mutation","ref":"feature/create-offer-mutation","sha":"44f9a4466ec7a33120f902e3a5e8e39d8dad89f4","user":{"login":"HedvigInsurance","id":31246138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjQ2MTM4","avatar_url":"https://avatars1.githubusercontent.com/u/31246138?v=4","gravatar_id":"","url":"https://api.github.com/users/HedvigInsurance","html_url":"https://github.com/HedvigInsurance","followers_url":"https://api.github.com/users/HedvigInsurance/followers","following_url":"https://api.github.com/users/HedvigInsurance/following{/other_user}","gists_url":"https://api.github.com/users/HedvigInsurance/gists{/gist_id}","starred_url":"https://api.github.com/users/HedvigInsurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HedvigInsurance/subscriptions","organizations_url":"https://api.github.com/users/HedvigInsurance/orgs","repos_url":"https://api.github.com/users/HedvigInsurance/repos","events_url":"https://api.github.com/users/HedvigInsurance/events{/privacy}","received_events_url":"https://api.github.com/users/HedvigInsurance/received_events","type":"Organization","site_admin":false},"repo":{"id":151245048,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEyNDUwNDg=","name":"giraffe","full_name":"HedvigInsurance/giraffe","private":false,"owner":{"login":"HedvigInsurance","id":31246138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjQ2MTM4","avatar_url":"https://avatars1.githubusercontent.com/u/31246138?v=4","gravatar_id":"","url":"https://api.github.com/users/HedvigInsurance","html_url":"https://github.com/HedvigInsurance","followers_url":"https://api.github.com/users/HedvigInsurance/followers","following_url":"https://api.github.com/users/HedvigInsurance/following{/other_user}","gists_url":"https://api.github.com/users/HedvigInsurance/gists{/gist_id}","starred_url":"https://api.github.com/users/HedvigInsurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HedvigInsurance/subscriptions","organizations_url":"https://api.github.com/users/HedvigInsurance/orgs","repos_url":"https://api.github.com/users/HedvigInsurance/repos","events_url":"https://api.github.com/users/HedvigInsurance/events{/privacy}","received_events_url":"https://api.github.com/users/HedvigInsurance/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HedvigInsurance/giraffe","description":"The Great GraphQL Giraffe! 🦒","fork":false,"url":"https://api.github.com/repos/HedvigInsurance/giraffe","forks_url":"https://api.github.com/repos/HedvigInsurance/giraffe/forks","keys_url":"https://api.github.com/repos/HedvigInsurance/giraffe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HedvigInsurance/giraffe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HedvigInsurance/giraffe/teams","hooks_url":"https://api.github.com/repos/HedvigInsurance/giraffe/hooks","issue_events_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/events{/number}","events_url":"https://api.github.com/repos/HedvigInsurance/giraffe/events","assignees_url":"https://api.github.com/repos/HedvigInsurance/giraffe/assignees{/user}","branches_url":"https://api.github.com/repos/HedvigInsurance/giraffe/branches{/branch}","tags_url":"https://api.github.com/repos/HedvigInsurance/giraffe/tags","blobs_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/refs{/sha}","trees_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HedvigInsurance/giraffe/statuses/{sha}","languages_url":"https://api.github.com/repos/HedvigInsurance/giraffe/languages","stargazers_url":"https://api.github.com/repos/HedvigInsurance/giraffe/stargazers","contributors_url":"https://api.github.com/repos/HedvigInsurance/giraffe/contributors","subscribers_url":"https://api.github.com/repos/HedvigInsurance/giraffe/subscribers","subscription_url":"https://api.github.com/repos/HedvigInsurance/giraffe/subscription","commits_url":"https://api.github.com/repos/HedvigInsurance/giraffe/commits{/sha}","git_commits_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/commits{/sha}","comments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/comments{/number}","issue_comment_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/comments{/number}","contents_url":"https://api.github.com/repos/HedvigInsurance/giraffe/contents/{+path}","compare_url":"https://api.github.com/repos/HedvigInsurance/giraffe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HedvigInsurance/giraffe/merges","archive_url":"https://api.github.com/repos/HedvigInsurance/giraffe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HedvigInsurance/giraffe/downloads","issues_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues{/number}","pulls_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls{/number}","milestones_url":"https://api.github.com/repos/HedvigInsurance/giraffe/milestones{/number}","notifications_url":"https://api.github.com/repos/HedvigInsurance/giraffe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HedvigInsurance/giraffe/labels{/name}","releases_url":"https://api.github.com/repos/HedvigInsurance/giraffe/releases{/id}","deployments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/deployments","created_at":"2018-10-02T11:41:47Z","updated_at":"2018-10-06T10:33:37Z","pushed_at":"2018-10-08T09:34:13Z","git_url":"git://github.com/HedvigInsurance/giraffe.git","ssh_url":"git@github.com:HedvigInsurance/giraffe.git","clone_url":"https://github.com/HedvigInsurance/giraffe.git","svn_url":"https://github.com/HedvigInsurance/giraffe","homepage":null,"size":350,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"HedvigInsurance:master","ref":"master","sha":"ee739d98161aa4b8c29d6fbb9804214de118bc33","user":{"login":"HedvigInsurance","id":31246138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjQ2MTM4","avatar_url":"https://avatars1.githubusercontent.com/u/31246138?v=4","gravatar_id":"","url":"https://api.github.com/users/HedvigInsurance","html_url":"https://github.com/HedvigInsurance","followers_url":"https://api.github.com/users/HedvigInsurance/followers","following_url":"https://api.github.com/users/HedvigInsurance/following{/other_user}","gists_url":"https://api.github.com/users/HedvigInsurance/gists{/gist_id}","starred_url":"https://api.github.com/users/HedvigInsurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HedvigInsurance/subscriptions","organizations_url":"https://api.github.com/users/HedvigInsurance/orgs","repos_url":"https://api.github.com/users/HedvigInsurance/repos","events_url":"https://api.github.com/users/HedvigInsurance/events{/privacy}","received_events_url":"https://api.github.com/users/HedvigInsurance/received_events","type":"Organization","site_admin":false},"repo":{"id":151245048,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEyNDUwNDg=","name":"giraffe","full_name":"HedvigInsurance/giraffe","private":false,"owner":{"login":"HedvigInsurance","id":31246138,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjQ2MTM4","avatar_url":"https://avatars1.githubusercontent.com/u/31246138?v=4","gravatar_id":"","url":"https://api.github.com/users/HedvigInsurance","html_url":"https://github.com/HedvigInsurance","followers_url":"https://api.github.com/users/HedvigInsurance/followers","following_url":"https://api.github.com/users/HedvigInsurance/following{/other_user}","gists_url":"https://api.github.com/users/HedvigInsurance/gists{/gist_id}","starred_url":"https://api.github.com/users/HedvigInsurance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HedvigInsurance/subscriptions","organizations_url":"https://api.github.com/users/HedvigInsurance/orgs","repos_url":"https://api.github.com/users/HedvigInsurance/repos","events_url":"https://api.github.com/users/HedvigInsurance/events{/privacy}","received_events_url":"https://api.github.com/users/HedvigInsurance/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HedvigInsurance/giraffe","description":"The Great GraphQL Giraffe! 🦒","fork":false,"url":"https://api.github.com/repos/HedvigInsurance/giraffe","forks_url":"https://api.github.com/repos/HedvigInsurance/giraffe/forks","keys_url":"https://api.github.com/repos/HedvigInsurance/giraffe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HedvigInsurance/giraffe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HedvigInsurance/giraffe/teams","hooks_url":"https://api.github.com/repos/HedvigInsurance/giraffe/hooks","issue_events_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/events{/number}","events_url":"https://api.github.com/repos/HedvigInsurance/giraffe/events","assignees_url":"https://api.github.com/repos/HedvigInsurance/giraffe/assignees{/user}","branches_url":"https://api.github.com/repos/HedvigInsurance/giraffe/branches{/branch}","tags_url":"https://api.github.com/repos/HedvigInsurance/giraffe/tags","blobs_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/refs{/sha}","trees_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HedvigInsurance/giraffe/statuses/{sha}","languages_url":"https://api.github.com/repos/HedvigInsurance/giraffe/languages","stargazers_url":"https://api.github.com/repos/HedvigInsurance/giraffe/stargazers","contributors_url":"https://api.github.com/repos/HedvigInsurance/giraffe/contributors","subscribers_url":"https://api.github.com/repos/HedvigInsurance/giraffe/subscribers","subscription_url":"https://api.github.com/repos/HedvigInsurance/giraffe/subscription","commits_url":"https://api.github.com/repos/HedvigInsurance/giraffe/commits{/sha}","git_commits_url":"https://api.github.com/repos/HedvigInsurance/giraffe/git/commits{/sha}","comments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/comments{/number}","issue_comment_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/comments{/number}","contents_url":"https://api.github.com/repos/HedvigInsurance/giraffe/contents/{+path}","compare_url":"https://api.github.com/repos/HedvigInsurance/giraffe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HedvigInsurance/giraffe/merges","archive_url":"https://api.github.com/repos/HedvigInsurance/giraffe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HedvigInsurance/giraffe/downloads","issues_url":"https://api.github.com/repos/HedvigInsurance/giraffe/issues{/number}","pulls_url":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls{/number}","milestones_url":"https://api.github.com/repos/HedvigInsurance/giraffe/milestones{/number}","notifications_url":"https://api.github.com/repos/HedvigInsurance/giraffe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HedvigInsurance/giraffe/labels{/name}","releases_url":"https://api.github.com/repos/HedvigInsurance/giraffe/releases{/id}","deployments_url":"https://api.github.com/repos/HedvigInsurance/giraffe/deployments","created_at":"2018-10-02T11:41:47Z","updated_at":"2018-10-06T10:33:37Z","pushed_at":"2018-10-08T09:34:13Z","git_url":"git://github.com/HedvigInsurance/giraffe.git","ssh_url":"git@github.com:HedvigInsurance/giraffe.git","clone_url":"https://github.com/HedvigInsurance/giraffe.git","svn_url":"https://github.com/HedvigInsurance/giraffe","homepage":null,"size":350,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4"},"html":{"href":"https://github.com/HedvigInsurance/giraffe/pull/4"},"issue":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/4"},"comments":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/HedvigInsurance/giraffe/statuses/44f9a4466ec7a33120f902e3a5e8e39d8dad89f4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"hedvigoscar"}}