{"action":"created","comment":{"url":"https://api.github.com/repos/newsuk/honey/pulls/comments/181791127","pull_request_review_id":112476886,"id":181791127,"diff_hunk":"@@ -1,65 +1,89 @@\n-import { createApolloFetch } from 'apollo-fetch';\n+import {createApolloFetch} from 'apollo-fetch';\n \n const uri = 'https://api.github.com/graphql';\n \n-const apolloFetch = createApolloFetch({ uri });\n+const apolloFetch = createApolloFetch({uri});\n \n-apolloFetch.use(({ options }, next) => {\n+const parseIssues = (project) => (project && project.data && project.data.repository && project.data.repository.issues)\n+  ? project.data.repository.issues\n+  : { totalCount: 0 };\n+\n+apolloFetch.use(({\n+  options\n+}, next) => {\n   if (!options.headers) {\n     // eslint-disable-next-line no-param-reassign\n     options.headers = {\n-      authorization: `bearer ${process.env.REACT_APP_GITHUB_KEY}`,\n+      authorization: `bearer ${process.env.REACT_APP_GITHUB_KEY}`\n     };\n   }\n   next();\n });\n \n-const totalIssuesGetRequest = project =>\n-  new Promise((resolve) => {\n-    apolloFetch({\n-      query: `query IssueCount($owner: String!, $repositoryName: String!) {\n+const totalIssuesGetRequest = project => new Promise((resolve) => {\n+  apolloFetch({","path":"src/provider/github.js","position":32,"original_position":32,"commit_id":"368e7e37fb01031ab37e572641386970cc698594","original_commit_id":"368e7e37fb01031ab37e572641386970cc698594","user":{"login":"shendriksen","id":23698167,"avatar_url":"https://avatars2.githubusercontent.com/u/23698167?v=4","gravatar_id":"","url":"https://api.github.com/users/shendriksen","html_url":"https://github.com/shendriksen","followers_url":"https://api.github.com/users/shendriksen/followers","following_url":"https://api.github.com/users/shendriksen/following{/other_user}","gists_url":"https://api.github.com/users/shendriksen/gists{/gist_id}","starred_url":"https://api.github.com/users/shendriksen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shendriksen/subscriptions","organizations_url":"https://api.github.com/users/shendriksen/orgs","repos_url":"https://api.github.com/users/shendriksen/repos","events_url":"https://api.github.com/users/shendriksen/events{/privacy}","received_events_url":"https://api.github.com/users/shendriksen/received_events","type":"User","site_admin":false},"body":"It's because we use Promise.all 'Promise.all(github.getTotalIssueCountFor(repositories))'. When a repository has no issues the the promise rejects. So we don't want the Promise.all to fail if a single repo has no issues.","created_at":"2018-04-16T15:50:16Z","updated_at":"2018-04-16T15:50:16Z","html_url":"https://github.com/newsuk/honey/pull/13#discussion_r181791127","pull_request_url":"https://api.github.com/repos/newsuk/honey/pulls/13","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/newsuk/honey/pulls/comments/181791127"},"html":{"href":"https://github.com/newsuk/honey/pull/13#discussion_r181791127"},"pull_request":{"href":"https://api.github.com/repos/newsuk/honey/pulls/13"}},"in_reply_to_id":181790134},"pull_request":{"url":"https://api.github.com/repos/newsuk/honey/pulls/13","id":181906185,"html_url":"https://github.com/newsuk/honey/pull/13","diff_url":"https://github.com/newsuk/honey/pull/13.diff","patch_url":"https://github.com/newsuk/honey/pull/13.patch","issue_url":"https://api.github.com/repos/newsuk/honey/issues/13","number":13,"state":"open","locked":false,"title":"Fix/authentication","user":{"login":"shendriksen","id":23698167,"avatar_url":"https://avatars2.githubusercontent.com/u/23698167?v=4","gravatar_id":"","url":"https://api.github.com/users/shendriksen","html_url":"https://github.com/shendriksen","followers_url":"https://api.github.com/users/shendriksen/followers","following_url":"https://api.github.com/users/shendriksen/following{/other_user}","gists_url":"https://api.github.com/users/shendriksen/gists{/gist_id}","starred_url":"https://api.github.com/users/shendriksen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shendriksen/subscriptions","organizations_url":"https://api.github.com/users/shendriksen/orgs","repos_url":"https://api.github.com/users/shendriksen/repos","events_url":"https://api.github.com/users/shendriksen/events{/privacy}","received_events_url":"https://api.github.com/users/shendriksen/received_events","type":"User","site_admin":false},"body":"Tools Account now has access to Render.\r\n\r\n- Apollo Error Handling.\r\n- Only show open defects.\r\n- Added private repos.","created_at":"2018-04-16T15:35:00Z","updated_at":"2018-04-16T15:50:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d338c5be22b1ec1f1e51cfba0d8eb66a856ed68","assignee":null,"assignees":[],"requested_reviewers":[{"login":"L0wry","id":12037104,"avatar_url":"https://avatars2.githubusercontent.com/u/12037104?v=4","gravatar_id":"","url":"https://api.github.com/users/L0wry","html_url":"https://github.com/L0wry","followers_url":"https://api.github.com/users/L0wry/followers","following_url":"https://api.github.com/users/L0wry/following{/other_user}","gists_url":"https://api.github.com/users/L0wry/gists{/gist_id}","starred_url":"https://api.github.com/users/L0wry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L0wry/subscriptions","organizations_url":"https://api.github.com/users/L0wry/orgs","repos_url":"https://api.github.com/users/L0wry/repos","events_url":"https://api.github.com/users/L0wry/events{/privacy}","received_events_url":"https://api.github.com/users/L0wry/received_events","type":"User","site_admin":false},{"login":"milesillsley","id":25321878,"avatar_url":"https://avatars0.githubusercontent.com/u/25321878?v=4","gravatar_id":"","url":"https://api.github.com/users/milesillsley","html_url":"https://github.com/milesillsley","followers_url":"https://api.github.com/users/milesillsley/followers","following_url":"https://api.github.com/users/milesillsley/following{/other_user}","gists_url":"https://api.github.com/users/milesillsley/gists{/gist_id}","starred_url":"https://api.github.com/users/milesillsley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milesillsley/subscriptions","organizations_url":"https://api.github.com/users/milesillsley/orgs","repos_url":"https://api.github.com/users/milesillsley/repos","events_url":"https://api.github.com/users/milesillsley/events{/privacy}","received_events_url":"https://api.github.com/users/milesillsley/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/newsuk/honey/pulls/13/commits","review_comments_url":"https://api.github.com/repos/newsuk/honey/pulls/13/comments","review_comment_url":"https://api.github.com/repos/newsuk/honey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/newsuk/honey/issues/13/comments","statuses_url":"https://api.github.com/repos/newsuk/honey/statuses/368e7e37fb01031ab37e572641386970cc698594","head":{"label":"newsuk:fix/authentication","ref":"fix/authentication","sha":"368e7e37fb01031ab37e572641386970cc698594","user":{"login":"newsuk","id":736306,"avatar_url":"https://avatars1.githubusercontent.com/u/736306?v=4","gravatar_id":"","url":"https://api.github.com/users/newsuk","html_url":"https://github.com/newsuk","followers_url":"https://api.github.com/users/newsuk/followers","following_url":"https://api.github.com/users/newsuk/following{/other_user}","gists_url":"https://api.github.com/users/newsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/newsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newsuk/subscriptions","organizations_url":"https://api.github.com/users/newsuk/orgs","repos_url":"https://api.github.com/users/newsuk/repos","events_url":"https://api.github.com/users/newsuk/events{/privacy}","received_events_url":"https://api.github.com/users/newsuk/received_events","type":"Organization","site_admin":false},"repo":{"id":126839920,"name":"honey","full_name":"newsuk/honey","owner":{"login":"newsuk","id":736306,"avatar_url":"https://avatars1.githubusercontent.com/u/736306?v=4","gravatar_id":"","url":"https://api.github.com/users/newsuk","html_url":"https://github.com/newsuk","followers_url":"https://api.github.com/users/newsuk/followers","following_url":"https://api.github.com/users/newsuk/following{/other_user}","gists_url":"https://api.github.com/users/newsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/newsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newsuk/subscriptions","organizations_url":"https://api.github.com/users/newsuk/orgs","repos_url":"https://api.github.com/users/newsuk/repos","events_url":"https://api.github.com/users/newsuk/events{/privacy}","received_events_url":"https://api.github.com/users/newsuk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/newsuk/honey","description":null,"fork":false,"url":"https://api.github.com/repos/newsuk/honey","forks_url":"https://api.github.com/repos/newsuk/honey/forks","keys_url":"https://api.github.com/repos/newsuk/honey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newsuk/honey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newsuk/honey/teams","hooks_url":"https://api.github.com/repos/newsuk/honey/hooks","issue_events_url":"https://api.github.com/repos/newsuk/honey/issues/events{/number}","events_url":"https://api.github.com/repos/newsuk/honey/events","assignees_url":"https://api.github.com/repos/newsuk/honey/assignees{/user}","branches_url":"https://api.github.com/repos/newsuk/honey/branches{/branch}","tags_url":"https://api.github.com/repos/newsuk/honey/tags","blobs_url":"https://api.github.com/repos/newsuk/honey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newsuk/honey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newsuk/honey/git/refs{/sha}","trees_url":"https://api.github.com/repos/newsuk/honey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newsuk/honey/statuses/{sha}","languages_url":"https://api.github.com/repos/newsuk/honey/languages","stargazers_url":"https://api.github.com/repos/newsuk/honey/stargazers","contributors_url":"https://api.github.com/repos/newsuk/honey/contributors","subscribers_url":"https://api.github.com/repos/newsuk/honey/subscribers","subscription_url":"https://api.github.com/repos/newsuk/honey/subscription","commits_url":"https://api.github.com/repos/newsuk/honey/commits{/sha}","git_commits_url":"https://api.github.com/repos/newsuk/honey/git/commits{/sha}","comments_url":"https://api.github.com/repos/newsuk/honey/comments{/number}","issue_comment_url":"https://api.github.com/repos/newsuk/honey/issues/comments{/number}","contents_url":"https://api.github.com/repos/newsuk/honey/contents/{+path}","compare_url":"https://api.github.com/repos/newsuk/honey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newsuk/honey/merges","archive_url":"https://api.github.com/repos/newsuk/honey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newsuk/honey/downloads","issues_url":"https://api.github.com/repos/newsuk/honey/issues{/number}","pulls_url":"https://api.github.com/repos/newsuk/honey/pulls{/number}","milestones_url":"https://api.github.com/repos/newsuk/honey/milestones{/number}","notifications_url":"https://api.github.com/repos/newsuk/honey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newsuk/honey/labels{/name}","releases_url":"https://api.github.com/repos/newsuk/honey/releases{/id}","deployments_url":"https://api.github.com/repos/newsuk/honey/deployments","created_at":"2018-03-26T14:18:03Z","updated_at":"2018-04-16T12:57:10Z","pushed_at":"2018-04-16T15:35:00Z","git_url":"git://github.com/newsuk/honey.git","ssh_url":"git@github.com:newsuk/honey.git","clone_url":"https://github.com/newsuk/honey.git","svn_url":"https://github.com/newsuk/honey","homepage":null,"size":195,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"newsuk:master","ref":"master","sha":"073d3ff32d92932ed0cc90f61119772881c1ad25","user":{"login":"newsuk","id":736306,"avatar_url":"https://avatars1.githubusercontent.com/u/736306?v=4","gravatar_id":"","url":"https://api.github.com/users/newsuk","html_url":"https://github.com/newsuk","followers_url":"https://api.github.com/users/newsuk/followers","following_url":"https://api.github.com/users/newsuk/following{/other_user}","gists_url":"https://api.github.com/users/newsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/newsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newsuk/subscriptions","organizations_url":"https://api.github.com/users/newsuk/orgs","repos_url":"https://api.github.com/users/newsuk/repos","events_url":"https://api.github.com/users/newsuk/events{/privacy}","received_events_url":"https://api.github.com/users/newsuk/received_events","type":"Organization","site_admin":false},"repo":{"id":126839920,"name":"honey","full_name":"newsuk/honey","owner":{"login":"newsuk","id":736306,"avatar_url":"https://avatars1.githubusercontent.com/u/736306?v=4","gravatar_id":"","url":"https://api.github.com/users/newsuk","html_url":"https://github.com/newsuk","followers_url":"https://api.github.com/users/newsuk/followers","following_url":"https://api.github.com/users/newsuk/following{/other_user}","gists_url":"https://api.github.com/users/newsuk/gists{/gist_id}","starred_url":"https://api.github.com/users/newsuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newsuk/subscriptions","organizations_url":"https://api.github.com/users/newsuk/orgs","repos_url":"https://api.github.com/users/newsuk/repos","events_url":"https://api.github.com/users/newsuk/events{/privacy}","received_events_url":"https://api.github.com/users/newsuk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/newsuk/honey","description":null,"fork":false,"url":"https://api.github.com/repos/newsuk/honey","forks_url":"https://api.github.com/repos/newsuk/honey/forks","keys_url":"https://api.github.com/repos/newsuk/honey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newsuk/honey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newsuk/honey/teams","hooks_url":"https://api.github.com/repos/newsuk/honey/hooks","issue_events_url":"https://api.github.com/repos/newsuk/honey/issues/events{/number}","events_url":"https://api.github.com/repos/newsuk/honey/events","assignees_url":"https://api.github.com/repos/newsuk/honey/assignees{/user}","branches_url":"https://api.github.com/repos/newsuk/honey/branches{/branch}","tags_url":"https://api.github.com/repos/newsuk/honey/tags","blobs_url":"https://api.github.com/repos/newsuk/honey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newsuk/honey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newsuk/honey/git/refs{/sha}","trees_url":"https://api.github.com/repos/newsuk/honey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newsuk/honey/statuses/{sha}","languages_url":"https://api.github.com/repos/newsuk/honey/languages","stargazers_url":"https://api.github.com/repos/newsuk/honey/stargazers","contributors_url":"https://api.github.com/repos/newsuk/honey/contributors","subscribers_url":"https://api.github.com/repos/newsuk/honey/subscribers","subscription_url":"https://api.github.com/repos/newsuk/honey/subscription","commits_url":"https://api.github.com/repos/newsuk/honey/commits{/sha}","git_commits_url":"https://api.github.com/repos/newsuk/honey/git/commits{/sha}","comments_url":"https://api.github.com/repos/newsuk/honey/comments{/number}","issue_comment_url":"https://api.github.com/repos/newsuk/honey/issues/comments{/number}","contents_url":"https://api.github.com/repos/newsuk/honey/contents/{+path}","compare_url":"https://api.github.com/repos/newsuk/honey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newsuk/honey/merges","archive_url":"https://api.github.com/repos/newsuk/honey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newsuk/honey/downloads","issues_url":"https://api.github.com/repos/newsuk/honey/issues{/number}","pulls_url":"https://api.github.com/repos/newsuk/honey/pulls{/number}","milestones_url":"https://api.github.com/repos/newsuk/honey/milestones{/number}","notifications_url":"https://api.github.com/repos/newsuk/honey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newsuk/honey/labels{/name}","releases_url":"https://api.github.com/repos/newsuk/honey/releases{/id}","deployments_url":"https://api.github.com/repos/newsuk/honey/deployments","created_at":"2018-03-26T14:18:03Z","updated_at":"2018-04-16T12:57:10Z","pushed_at":"2018-04-16T15:35:00Z","git_url":"git://github.com/newsuk/honey.git","ssh_url":"git@github.com:newsuk/honey.git","clone_url":"https://github.com/newsuk/honey.git","svn_url":"https://github.com/newsuk/honey","homepage":null,"size":195,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/newsuk/honey/pulls/13"},"html":{"href":"https://github.com/newsuk/honey/pull/13"},"issue":{"href":"https://api.github.com/repos/newsuk/honey/issues/13"},"comments":{"href":"https://api.github.com/repos/newsuk/honey/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/newsuk/honey/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/newsuk/honey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/newsuk/honey/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/newsuk/honey/statuses/368e7e37fb01031ab37e572641386970cc698594"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shendriksen"}}