{"action":"created","comment":{"url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/comments/209326745","pull_request_review_id":145320832,"id":209326745,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTMyNjc0NQ==","diff_hunk":"@@ -165,3 +205,107 @@ export const Issue = {\n   },\n   activeLockReason({ source }) { return source['active_lock_reason']; },\n }\n+\n+export const PullRequestCollection = {\n+  async one({ self, source, args }) {\n+    const { name: owner } = self.match(root.users.one());\n+    const { name: repo } = self.match(root.users.one().repos().one());\n+    const { number } = args;\n+    const result = await client.pullRequests.get({ owner, repo, number });\n+    return result.data;\n+  },\n+\n+  async page({ self, source, args }) {\n+    const { name: owner } = self.match(root.users.one());\n+    const { name: repo } = self.match(root.users.one().repos().one());\n+\n+    const apiArgs = toApiArgs(args, { owner, repo });\n+    const res = await client.pullRequests.getAll(apiArgs);\n+\n+    return {\n+      items: res.data,\n+      next: getNextPageRef(self.page(args), res),\n+    };\n+  }\n+}\n+\n+export const PullRequest = {\n+  self({ self, parent, source }) {\n+    return parent.parent.parent.one({ number: source.number });\n+  },\n+  activeLockReason({ source }) { return source['active_lock_reason']; },\n+  files({ self, source }) { return {}; },\n+  // async files ({ self, source}){\n+  //   const { name: owner } = self.match(root.users.one());\n+  //   const { name: repo } = self.match(root.users.one().repos().one());\n+  //   const { number } = source;\n+\n+  //   return client.pullRequests.getFiles({owner, repo, number})\n+  // }\n+}\n+\n+export const HooksCollection = {\n+  async one({ self, source, args }) {\n+    const { name: owner } = self.match(root.users.one());\n+    const { name: repo } = self.match(root.users.one().repos().one());\n+    const { id } = args;\n+    const result = await octokit.repos.getHook({owner, repo, id});\n+    return result.data;\n+  },\n+\n+  async page({ self, source, args }) {\n+    const { name: owner } = self.match(root.users.one());\n+    const { name: repo } = self.match(root.users.one().repos().one());\n+\n+    const apiArgs = toApiArgs(args, { owner, repo });\n+    const res = await client.repos.getHooks(apiArgs);\n+\n+    return {\n+      items: res.data,\n+      next: getNextPageRef(self.page(args), res),\n+    };\n+  }\n+}\n+\n+export const Hook = {\n+  self({ self, parent, source }) {\n+    return self || parent.ref.pop().pop().push('one', { id: source.hook_id });","path":"index.js","position":137,"original_position":137,"commit_id":"66f11311cc22f368619aeccdcc8a75fed812aee6","original_commit_id":"66f11311cc22f368619aeccdcc8a75fed812aee6","user":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"body":"`self` resolvers should now be written in this form:\r\n\r\n`return parent.parent.parent.one({ id: source.hook_id })`\r\n\r\nFor clarity, here's what it means:\r\n\r\n - `parent` is a ref to the `[Hook]` inside a page\r\n - `parent.parent` is a ref to the the `HookPage` in the collection\r\n - `parent.parent.parent` is a ref to the `HookCollection`\r\n - And from the ref to the collection we just go into the `one` field with the right id","created_at":"2018-08-10T17:11:00Z","updated_at":"2018-08-10T17:16:24Z","html_url":"https://github.com/juancampa/membrane-driver-github/pull/1#discussion_r209326745","pull_request_url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/comments/209326745"},"html":{"href":"https://github.com/juancampa/membrane-driver-github/pull/1#discussion_r209326745"},"pull_request":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1","id":207667806,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NjY3ODA2","html_url":"https://github.com/juancampa/membrane-driver-github/pull/1","diff_url":"https://github.com/juancampa/membrane-driver-github/pull/1.diff","patch_url":"https://github.com/juancampa/membrane-driver-github/pull/1.patch","issue_url":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/1","number":1,"state":"open","locked":false,"title":"Add events.","user":{"login":"aranajhonny","id":9091881,"node_id":"MDQ6VXNlcjkwOTE4ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/9091881?v=4","gravatar_id":"","url":"https://api.github.com/users/aranajhonny","html_url":"https://github.com/aranajhonny","followers_url":"https://api.github.com/users/aranajhonny/followers","following_url":"https://api.github.com/users/aranajhonny/following{/other_user}","gists_url":"https://api.github.com/users/aranajhonny/gists{/gist_id}","starred_url":"https://api.github.com/users/aranajhonny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aranajhonny/subscriptions","organizations_url":"https://api.github.com/users/aranajhonny/orgs","repos_url":"https://api.github.com/users/aranajhonny/repos","events_url":"https://api.github.com/users/aranajhonny/events{/privacy}","received_events_url":"https://api.github.com/users/aranajhonny/received_events","type":"User","site_admin":false},"body":"* `issueOpened`\r\n* `pullRequestOpened`\r\n* `PullRequestCollection`\r\n* `PullRequestPage`\r\n* `PullRequest`","created_at":"2018-08-10T16:51:59Z","updated_at":"2018-08-10T17:16:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d15d52ecb4d168c69f254124b4619f3d5b1bcb58","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1/commits","review_comments_url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1/comments","review_comment_url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/1/comments","statuses_url":"https://api.github.com/repos/juancampa/membrane-driver-github/statuses/66f11311cc22f368619aeccdcc8a75fed812aee6","head":{"label":"aranajhonny:master","ref":"master","sha":"66f11311cc22f368619aeccdcc8a75fed812aee6","user":{"login":"aranajhonny","id":9091881,"node_id":"MDQ6VXNlcjkwOTE4ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/9091881?v=4","gravatar_id":"","url":"https://api.github.com/users/aranajhonny","html_url":"https://github.com/aranajhonny","followers_url":"https://api.github.com/users/aranajhonny/followers","following_url":"https://api.github.com/users/aranajhonny/following{/other_user}","gists_url":"https://api.github.com/users/aranajhonny/gists{/gist_id}","starred_url":"https://api.github.com/users/aranajhonny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aranajhonny/subscriptions","organizations_url":"https://api.github.com/users/aranajhonny/orgs","repos_url":"https://api.github.com/users/aranajhonny/repos","events_url":"https://api.github.com/users/aranajhonny/events{/privacy}","received_events_url":"https://api.github.com/users/aranajhonny/received_events","type":"User","site_admin":false},"repo":{"id":144200481,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQyMDA0ODE=","name":"membrane-driver-github","full_name":"aranajhonny/membrane-driver-github","owner":{"login":"aranajhonny","id":9091881,"node_id":"MDQ6VXNlcjkwOTE4ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/9091881?v=4","gravatar_id":"","url":"https://api.github.com/users/aranajhonny","html_url":"https://github.com/aranajhonny","followers_url":"https://api.github.com/users/aranajhonny/followers","following_url":"https://api.github.com/users/aranajhonny/following{/other_user}","gists_url":"https://api.github.com/users/aranajhonny/gists{/gist_id}","starred_url":"https://api.github.com/users/aranajhonny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aranajhonny/subscriptions","organizations_url":"https://api.github.com/users/aranajhonny/orgs","repos_url":"https://api.github.com/users/aranajhonny/repos","events_url":"https://api.github.com/users/aranajhonny/events{/privacy}","received_events_url":"https://api.github.com/users/aranajhonny/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aranajhonny/membrane-driver-github","description":null,"fork":true,"url":"https://api.github.com/repos/aranajhonny/membrane-driver-github","forks_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/forks","keys_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/teams","hooks_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/hooks","issue_events_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/issues/events{/number}","events_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/events","assignees_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/assignees{/user}","branches_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/branches{/branch}","tags_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/tags","blobs_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/statuses/{sha}","languages_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/languages","stargazers_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/stargazers","contributors_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/contributors","subscribers_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/subscribers","subscription_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/subscription","commits_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/contents/{+path}","compare_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/merges","archive_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/downloads","issues_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/issues{/number}","pulls_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/pulls{/number}","milestones_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/milestones{/number}","notifications_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/labels{/name}","releases_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/releases{/id}","deployments_url":"https://api.github.com/repos/aranajhonny/membrane-driver-github/deployments","created_at":"2018-08-09T20:28:19Z","updated_at":"2018-08-10T03:21:48Z","pushed_at":"2018-08-10T03:21:45Z","git_url":"git://github.com/aranajhonny/membrane-driver-github.git","ssh_url":"git@github.com:aranajhonny/membrane-driver-github.git","clone_url":"https://github.com/aranajhonny/membrane-driver-github.git","svn_url":"https://github.com/aranajhonny/membrane-driver-github","homepage":null,"size":41,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"juancampa:master","ref":"master","sha":"ee97e80ff6f2aac0c1eacf2b29ec96c6f0474a57","user":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"repo":{"id":132169008,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxNjkwMDg=","name":"membrane-driver-github","full_name":"juancampa/membrane-driver-github","owner":{"login":"juancampa","id":1410520,"node_id":"MDQ6VXNlcjE0MTA1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/1410520?v=4","gravatar_id":"","url":"https://api.github.com/users/juancampa","html_url":"https://github.com/juancampa","followers_url":"https://api.github.com/users/juancampa/followers","following_url":"https://api.github.com/users/juancampa/following{/other_user}","gists_url":"https://api.github.com/users/juancampa/gists{/gist_id}","starred_url":"https://api.github.com/users/juancampa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juancampa/subscriptions","organizations_url":"https://api.github.com/users/juancampa/orgs","repos_url":"https://api.github.com/users/juancampa/repos","events_url":"https://api.github.com/users/juancampa/events{/privacy}","received_events_url":"https://api.github.com/users/juancampa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juancampa/membrane-driver-github","description":null,"fork":false,"url":"https://api.github.com/repos/juancampa/membrane-driver-github","forks_url":"https://api.github.com/repos/juancampa/membrane-driver-github/forks","keys_url":"https://api.github.com/repos/juancampa/membrane-driver-github/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juancampa/membrane-driver-github/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juancampa/membrane-driver-github/teams","hooks_url":"https://api.github.com/repos/juancampa/membrane-driver-github/hooks","issue_events_url":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/events{/number}","events_url":"https://api.github.com/repos/juancampa/membrane-driver-github/events","assignees_url":"https://api.github.com/repos/juancampa/membrane-driver-github/assignees{/user}","branches_url":"https://api.github.com/repos/juancampa/membrane-driver-github/branches{/branch}","tags_url":"https://api.github.com/repos/juancampa/membrane-driver-github/tags","blobs_url":"https://api.github.com/repos/juancampa/membrane-driver-github/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juancampa/membrane-driver-github/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juancampa/membrane-driver-github/git/refs{/sha}","trees_url":"https://api.github.com/repos/juancampa/membrane-driver-github/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juancampa/membrane-driver-github/statuses/{sha}","languages_url":"https://api.github.com/repos/juancampa/membrane-driver-github/languages","stargazers_url":"https://api.github.com/repos/juancampa/membrane-driver-github/stargazers","contributors_url":"https://api.github.com/repos/juancampa/membrane-driver-github/contributors","subscribers_url":"https://api.github.com/repos/juancampa/membrane-driver-github/subscribers","subscription_url":"https://api.github.com/repos/juancampa/membrane-driver-github/subscription","commits_url":"https://api.github.com/repos/juancampa/membrane-driver-github/commits{/sha}","git_commits_url":"https://api.github.com/repos/juancampa/membrane-driver-github/git/commits{/sha}","comments_url":"https://api.github.com/repos/juancampa/membrane-driver-github/comments{/number}","issue_comment_url":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/comments{/number}","contents_url":"https://api.github.com/repos/juancampa/membrane-driver-github/contents/{+path}","compare_url":"https://api.github.com/repos/juancampa/membrane-driver-github/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juancampa/membrane-driver-github/merges","archive_url":"https://api.github.com/repos/juancampa/membrane-driver-github/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juancampa/membrane-driver-github/downloads","issues_url":"https://api.github.com/repos/juancampa/membrane-driver-github/issues{/number}","pulls_url":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls{/number}","milestones_url":"https://api.github.com/repos/juancampa/membrane-driver-github/milestones{/number}","notifications_url":"https://api.github.com/repos/juancampa/membrane-driver-github/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juancampa/membrane-driver-github/labels{/name}","releases_url":"https://api.github.com/repos/juancampa/membrane-driver-github/releases{/id}","deployments_url":"https://api.github.com/repos/juancampa/membrane-driver-github/deployments","created_at":"2018-05-04T17:20:25Z","updated_at":"2018-07-22T15:12:53Z","pushed_at":"2018-08-10T16:51:59Z","git_url":"git://github.com/juancampa/membrane-driver-github.git","ssh_url":"git@github.com:juancampa/membrane-driver-github.git","clone_url":"https://github.com/juancampa/membrane-driver-github.git","svn_url":"https://github.com/juancampa/membrane-driver-github","homepage":null,"size":15,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1"},"html":{"href":"https://github.com/juancampa/membrane-driver-github/pull/1"},"issue":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/1"},"comments":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/juancampa/membrane-driver-github/statuses/66f11311cc22f368619aeccdcc8a75fed812aee6"}},"author_association":"NONE"}}
{"actor":{"display_login":"juancampa"}}