{"action":"created","comment":{"url":"https://api.github.com/repos/Financial-Times/next-article/pulls/comments/89324030","pull_request_review_id":9869545,"id":89324030,"diff_hunk":"@@ -0,0 +1,33 @@\n+const logger = require('@financial-times/n-logger').default;\n+const fetchGraphqlData = require('../../lib/fetch-graphql-data');\n+const readNextQuery = require('../../graphql-queries/read-next');\n+const getSuggestedReads = require('./suggested');\n+const getReadNext = require('./read-next');\n+\n+module.exports = function (articleId, publishedDate) {\n+\n+\tconst variables = {\n+\t\tuuid: articleId,\n+\t\tlimitPrimaryTag: 6,\n+\t\tlimitStoryPackage: 5\n+\t}\n+\n+\treturn fetchGraphqlData(readNextQuery, variables)\n+\t\t.then(({ article = [] } = {}) => {\n+\t\t\tlet { primaryTag: { latestContent: topicArticles } } = article;\n+\t\t\t// filter out parent article from the topic articles\n+\t\t\ttopicArticles = topicArticles.filter(article => article.id !== articleId);\n+\t\t\tconst { storyPackage: packageArticles } = article;\n+\t\t\tif (!topicArticles && !packageArticles) {\n+\t\t\t\treturn;\n+\t\t\t}\n+\n+\t\t\treturn {\n+\t\t\t\treadNext: getReadNext(topicArticles, packageArticles, publishedDate),\n+\t\t\t\tsuggestedReads: getSuggestedReads(topicArticles, packageArticles)\n+\t\t\t};\n+\t\t})\n+\t\t.catch(\n+\t\t\terror => logger.warn('Fetching onward journey data failed.', error.toString())\n+\t\t);\n+};","path":"server/controllers/article-helpers/onward-journey.js","position":33,"original_position":33,"commit_id":"671f67f9e0c379befdf694d1e5b78163f03b8a54","original_commit_id":"671f67f9e0c379befdf694d1e5b78163f03b8a54","user":{"login":"ironsidevsquincy","id":74132,"avatar_url":"https://avatars.githubusercontent.com/u/74132?v=3","gravatar_id":"","url":"https://api.github.com/users/ironsidevsquincy","html_url":"https://github.com/ironsidevsquincy","followers_url":"https://api.github.com/users/ironsidevsquincy/followers","following_url":"https://api.github.com/users/ironsidevsquincy/following{/other_user}","gists_url":"https://api.github.com/users/ironsidevsquincy/gists{/gist_id}","starred_url":"https://api.github.com/users/ironsidevsquincy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironsidevsquincy/subscriptions","organizations_url":"https://api.github.com/users/ironsidevsquincy/orgs","repos_url":"https://api.github.com/users/ironsidevsquincy/repos","events_url":"https://api.github.com/users/ironsidevsquincy/events{/privacy}","received_events_url":"https://api.github.com/users/ironsidevsquincy/received_events","type":"User","site_admin":false},"body":"will probably get a clash with the PR I just merged - https://github.com/Financial-Times/next-article/blob/e485e394e7a69b790ea039452939f7acff7f2e28/server/controllers/article-helpers/read-next.js\r\n\r\nUpdate what was read-next to handle articles without a `primaryTag` (like video content is currently)","created_at":"2016-11-23T14:19:09Z","updated_at":"2016-11-23T14:19:09Z","html_url":"https://github.com/Financial-Times/next-article/pull/1691#discussion_r89324030","pull_request_url":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691","_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/comments/89324030"},"html":{"href":"https://github.com/Financial-Times/next-article/pull/1691#discussion_r89324030"},"pull_request":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691"}}},"pull_request":{"url":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691","id":94665685,"html_url":"https://github.com/Financial-Times/next-article/pull/1691","diff_url":"https://github.com/Financial-Times/next-article/pull/1691.diff","patch_url":"https://github.com/Financial-Times/next-article/pull/1691.patch","issue_url":"https://api.github.com/repos/Financial-Times/next-article/issues/1691","number":1691,"state":"open","locked":false,"title":"Amend: migrate suggested reads to next api","user":{"login":"andygnewman","id":8938227,"avatar_url":"https://avatars.githubusercontent.com/u/8938227?v=3","gravatar_id":"","url":"https://api.github.com/users/andygnewman","html_url":"https://github.com/andygnewman","followers_url":"https://api.github.com/users/andygnewman/followers","following_url":"https://api.github.com/users/andygnewman/following{/other_user}","gists_url":"https://api.github.com/users/andygnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/andygnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andygnewman/subscriptions","organizations_url":"https://api.github.com/users/andygnewman/orgs","repos_url":"https://api.github.com/users/andygnewman/repos","events_url":"https://api.github.com/users/andygnewman/events{/privacy}","received_events_url":"https://api.github.com/users/andygnewman/received_events","type":"User","site_admin":false},"body":"cc: @ironsidevsquincy @andygout \r\nFinal part of the migration (https://github.com/Financial-Times/next-article/issues/1680) of related content elements of the article page to next-api (graphql)\r\n\r\n","created_at":"2016-11-21T18:00:10Z","updated_at":"2016-11-23T14:19:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b14d093101b7a2b9fdf3927d1f4478b13e69711f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/next-article/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/next-article/issues/1691/comments","statuses_url":"https://api.github.com/repos/Financial-Times/next-article/statuses/671f67f9e0c379befdf694d1e5b78163f03b8a54","head":{"label":"Financial-Times:suggested-reads-next-api","ref":"suggested-reads-next-api","sha":"671f67f9e0c379befdf694d1e5b78163f03b8a54","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":26121818,"name":"next-article","full_name":"Financial-Times/next-article","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-article","description":"Articles","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-article","forks_url":"https://api.github.com/repos/Financial-Times/next-article/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-article/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-article/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-article/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-article/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-article/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-article/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-article/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-article/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-article/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-article/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-article/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-article/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-article/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-article/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-article/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-article/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-article/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-article/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-article/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-article/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-article/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-article/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-article/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-article/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-article/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-article/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-article/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-article/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-article/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-article/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-article/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-article/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-article/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-article/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-article/deployments","created_at":"2014-11-03T14:22:04Z","updated_at":"2016-11-09T20:24:14Z","pushed_at":"2016-11-23T14:17:45Z","git_url":"git://github.com/Financial-Times/next-article.git","ssh_url":"git@github.com:Financial-Times/next-article.git","clone_url":"https://github.com/Financial-Times/next-article.git","svn_url":"https://github.com/Financial-Times/next-article","homepage":"","size":10862,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":32,"forks":6,"open_issues":32,"watchers":9,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"39608f37aa752bf223e34bc485b925acb65b894e","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":26121818,"name":"next-article","full_name":"Financial-Times/next-article","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-article","description":"Articles","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-article","forks_url":"https://api.github.com/repos/Financial-Times/next-article/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-article/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-article/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-article/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-article/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-article/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-article/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-article/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-article/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-article/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-article/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-article/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-article/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-article/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-article/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-article/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-article/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-article/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-article/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-article/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-article/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-article/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-article/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-article/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-article/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-article/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-article/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-article/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-article/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-article/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-article/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-article/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-article/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-article/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-article/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-article/deployments","created_at":"2014-11-03T14:22:04Z","updated_at":"2016-11-09T20:24:14Z","pushed_at":"2016-11-23T14:17:45Z","git_url":"git://github.com/Financial-Times/next-article.git","ssh_url":"git@github.com:Financial-Times/next-article.git","clone_url":"https://github.com/Financial-Times/next-article.git","svn_url":"https://github.com/Financial-Times/next-article","homepage":"","size":10862,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":32,"forks":6,"open_issues":32,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691"},"html":{"href":"https://github.com/Financial-Times/next-article/pull/1691"},"issue":{"href":"https://api.github.com/repos/Financial-Times/next-article/issues/1691"},"comments":{"href":"https://api.github.com/repos/Financial-Times/next-article/issues/1691/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/next-article/pulls/1691/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/next-article/statuses/671f67f9e0c379befdf694d1e5b78163f03b8a54"}}}}
{"actor":{"display_login":"ironsidevsquincy"}}