{"action":"created","comment":{"url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/comments/191367043","pull_request_review_id":123922838,"id":191367043,"diff_hunk":"@@ -2,90 +2,87 @@\n \n namespace Bakery\\Types;\n \n+use Bakery\\Utils\\Utils;\n use Bakery\\Support\\Facades\\Bakery;\n-use GraphQL\\Type\\Definition\\ListOfType;\n use GraphQL\\Type\\Definition\\NonNull;\n-use Illuminate\\Auth\\Access\\AuthorizationException;\n+use GraphQL\\Type\\Definition\\ListOfType;\n use Illuminate\\Contracts\\Auth\\Access\\Gate;\n+use Illuminate\\Auth\\Access\\AuthorizationException;\n \n-class EntityType extends Type\n+class EntityType extends ModelAwareType\n {\n-    protected $name;\n-\n-    protected $model;\n+    /**\n+     * Get the name of the Entity type.\n+     *\n+     * @return string\n+     */\n+    protected function name(): string\n+    {\n+        return Utils::typename($this->model->getModel());\n+    }\n \n-    public function __construct(string $class)\n+    private function createFieldResolver($field, $key)","path":"src/Types/EntityType.php","position":30,"original_position":30,"commit_id":"728ffd5a2a8796b36620001daa0ec89c4fbb4731","original_commit_id":"728ffd5a2a8796b36620001daa0ec89c4fbb4731","user":{"login":"codeclimate[bot]","id":36754821,"avatar_url":"https://avatars0.githubusercontent.com/in/9403?v=4","gravatar_id":"","url":"https://api.github.com/users/codeclimate%5Bbot%5D","html_url":"https://github.com/apps/codeclimate","followers_url":"https://api.github.com/users/codeclimate%5Bbot%5D/followers","following_url":"https://api.github.com/users/codeclimate%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codeclimate%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codeclimate%5Bbot%5D/repos","events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Function `createFieldResolver` has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.","created_at":"2018-05-29T09:55:32Z","updated_at":"2018-05-29T09:55:32Z","html_url":"https://github.com/scrnhq/laravel-bakery/pull/34#discussion_r191367043","pull_request_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/comments/191367043"},"html":{"href":"https://github.com/scrnhq/laravel-bakery/pull/34#discussion_r191367043"},"pull_request":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34","id":191071734,"html_url":"https://github.com/scrnhq/laravel-bakery/pull/34","diff_url":"https://github.com/scrnhq/laravel-bakery/pull/34.diff","patch_url":"https://github.com/scrnhq/laravel-bakery/pull/34.patch","issue_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/34","number":34,"state":"open","locked":false,"title":"🚀 New API","user":{"login":"rovansteen","id":14931924,"avatar_url":"https://avatars0.githubusercontent.com/u/14931924?v=4","gravatar_id":"","url":"https://api.github.com/users/rovansteen","html_url":"https://github.com/rovansteen","followers_url":"https://api.github.com/users/rovansteen/followers","following_url":"https://api.github.com/users/rovansteen/following{/other_user}","gists_url":"https://api.github.com/users/rovansteen/gists{/gist_id}","starred_url":"https://api.github.com/users/rovansteen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rovansteen/subscriptions","organizations_url":"https://api.github.com/users/rovansteen/orgs","repos_url":"https://api.github.com/users/rovansteen/repos","events_url":"https://api.github.com/users/rovansteen/events{/privacy}","received_events_url":"https://api.github.com/users/rovansteen/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-29T08:42:56Z","updated_at":"2018-05-29T09:55:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a31855ca36af25fd7359c926ef4b8ab85f4f4fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34/commits","review_comments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34/comments","review_comment_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/34/comments","statuses_url":"https://api.github.com/repos/scrnhq/laravel-bakery/statuses/728ffd5a2a8796b36620001daa0ec89c4fbb4731","head":{"label":"scrnhq:feature/new-api","ref":"feature/new-api","sha":"728ffd5a2a8796b36620001daa0ec89c4fbb4731","user":{"login":"scrnhq","id":22395618,"avatar_url":"https://avatars0.githubusercontent.com/u/22395618?v=4","gravatar_id":"","url":"https://api.github.com/users/scrnhq","html_url":"https://github.com/scrnhq","followers_url":"https://api.github.com/users/scrnhq/followers","following_url":"https://api.github.com/users/scrnhq/following{/other_user}","gists_url":"https://api.github.com/users/scrnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/scrnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrnhq/subscriptions","organizations_url":"https://api.github.com/users/scrnhq/orgs","repos_url":"https://api.github.com/users/scrnhq/repos","events_url":"https://api.github.com/users/scrnhq/events{/privacy}","received_events_url":"https://api.github.com/users/scrnhq/received_events","type":"Organization","site_admin":false},"repo":{"id":109427894,"name":"laravel-bakery","full_name":"scrnhq/laravel-bakery","owner":{"login":"scrnhq","id":22395618,"avatar_url":"https://avatars0.githubusercontent.com/u/22395618?v=4","gravatar_id":"","url":"https://api.github.com/users/scrnhq","html_url":"https://github.com/scrnhq","followers_url":"https://api.github.com/users/scrnhq/followers","following_url":"https://api.github.com/users/scrnhq/following{/other_user}","gists_url":"https://api.github.com/users/scrnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/scrnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrnhq/subscriptions","organizations_url":"https://api.github.com/users/scrnhq/orgs","repos_url":"https://api.github.com/users/scrnhq/repos","events_url":"https://api.github.com/users/scrnhq/events{/privacy}","received_events_url":"https://api.github.com/users/scrnhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrnhq/laravel-bakery","description":"An on-the-fly GraphQL Schema generator from Eloquent models for Laravel.","fork":false,"url":"https://api.github.com/repos/scrnhq/laravel-bakery","forks_url":"https://api.github.com/repos/scrnhq/laravel-bakery/forks","keys_url":"https://api.github.com/repos/scrnhq/laravel-bakery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrnhq/laravel-bakery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrnhq/laravel-bakery/teams","hooks_url":"https://api.github.com/repos/scrnhq/laravel-bakery/hooks","issue_events_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/events{/number}","events_url":"https://api.github.com/repos/scrnhq/laravel-bakery/events","assignees_url":"https://api.github.com/repos/scrnhq/laravel-bakery/assignees{/user}","branches_url":"https://api.github.com/repos/scrnhq/laravel-bakery/branches{/branch}","tags_url":"https://api.github.com/repos/scrnhq/laravel-bakery/tags","blobs_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrnhq/laravel-bakery/statuses/{sha}","languages_url":"https://api.github.com/repos/scrnhq/laravel-bakery/languages","stargazers_url":"https://api.github.com/repos/scrnhq/laravel-bakery/stargazers","contributors_url":"https://api.github.com/repos/scrnhq/laravel-bakery/contributors","subscribers_url":"https://api.github.com/repos/scrnhq/laravel-bakery/subscribers","subscription_url":"https://api.github.com/repos/scrnhq/laravel-bakery/subscription","commits_url":"https://api.github.com/repos/scrnhq/laravel-bakery/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrnhq/laravel-bakery/contents/{+path}","compare_url":"https://api.github.com/repos/scrnhq/laravel-bakery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrnhq/laravel-bakery/merges","archive_url":"https://api.github.com/repos/scrnhq/laravel-bakery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrnhq/laravel-bakery/downloads","issues_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues{/number}","pulls_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls{/number}","milestones_url":"https://api.github.com/repos/scrnhq/laravel-bakery/milestones{/number}","notifications_url":"https://api.github.com/repos/scrnhq/laravel-bakery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrnhq/laravel-bakery/labels{/name}","releases_url":"https://api.github.com/repos/scrnhq/laravel-bakery/releases{/id}","deployments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/deployments","created_at":"2017-11-03T18:07:39Z","updated_at":"2018-04-22T17:38:01Z","pushed_at":"2018-05-29T09:55:12Z","git_url":"git://github.com/scrnhq/laravel-bakery.git","ssh_url":"git@github.com:scrnhq/laravel-bakery.git","clone_url":"https://github.com/scrnhq/laravel-bakery.git","svn_url":"https://github.com/scrnhq/laravel-bakery","homepage":"","size":292,"stargazers_count":7,"watchers_count":7,"language":"PHP","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":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":9,"watchers":7,"default_branch":"master"}},"base":{"label":"scrnhq:master","ref":"master","sha":"308127f27524a57d4531bfb5401129e983451564","user":{"login":"scrnhq","id":22395618,"avatar_url":"https://avatars0.githubusercontent.com/u/22395618?v=4","gravatar_id":"","url":"https://api.github.com/users/scrnhq","html_url":"https://github.com/scrnhq","followers_url":"https://api.github.com/users/scrnhq/followers","following_url":"https://api.github.com/users/scrnhq/following{/other_user}","gists_url":"https://api.github.com/users/scrnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/scrnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrnhq/subscriptions","organizations_url":"https://api.github.com/users/scrnhq/orgs","repos_url":"https://api.github.com/users/scrnhq/repos","events_url":"https://api.github.com/users/scrnhq/events{/privacy}","received_events_url":"https://api.github.com/users/scrnhq/received_events","type":"Organization","site_admin":false},"repo":{"id":109427894,"name":"laravel-bakery","full_name":"scrnhq/laravel-bakery","owner":{"login":"scrnhq","id":22395618,"avatar_url":"https://avatars0.githubusercontent.com/u/22395618?v=4","gravatar_id":"","url":"https://api.github.com/users/scrnhq","html_url":"https://github.com/scrnhq","followers_url":"https://api.github.com/users/scrnhq/followers","following_url":"https://api.github.com/users/scrnhq/following{/other_user}","gists_url":"https://api.github.com/users/scrnhq/gists{/gist_id}","starred_url":"https://api.github.com/users/scrnhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrnhq/subscriptions","organizations_url":"https://api.github.com/users/scrnhq/orgs","repos_url":"https://api.github.com/users/scrnhq/repos","events_url":"https://api.github.com/users/scrnhq/events{/privacy}","received_events_url":"https://api.github.com/users/scrnhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scrnhq/laravel-bakery","description":"An on-the-fly GraphQL Schema generator from Eloquent models for Laravel.","fork":false,"url":"https://api.github.com/repos/scrnhq/laravel-bakery","forks_url":"https://api.github.com/repos/scrnhq/laravel-bakery/forks","keys_url":"https://api.github.com/repos/scrnhq/laravel-bakery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scrnhq/laravel-bakery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scrnhq/laravel-bakery/teams","hooks_url":"https://api.github.com/repos/scrnhq/laravel-bakery/hooks","issue_events_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/events{/number}","events_url":"https://api.github.com/repos/scrnhq/laravel-bakery/events","assignees_url":"https://api.github.com/repos/scrnhq/laravel-bakery/assignees{/user}","branches_url":"https://api.github.com/repos/scrnhq/laravel-bakery/branches{/branch}","tags_url":"https://api.github.com/repos/scrnhq/laravel-bakery/tags","blobs_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/refs{/sha}","trees_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scrnhq/laravel-bakery/statuses/{sha}","languages_url":"https://api.github.com/repos/scrnhq/laravel-bakery/languages","stargazers_url":"https://api.github.com/repos/scrnhq/laravel-bakery/stargazers","contributors_url":"https://api.github.com/repos/scrnhq/laravel-bakery/contributors","subscribers_url":"https://api.github.com/repos/scrnhq/laravel-bakery/subscribers","subscription_url":"https://api.github.com/repos/scrnhq/laravel-bakery/subscription","commits_url":"https://api.github.com/repos/scrnhq/laravel-bakery/commits{/sha}","git_commits_url":"https://api.github.com/repos/scrnhq/laravel-bakery/git/commits{/sha}","comments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/comments{/number}","issue_comment_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/comments{/number}","contents_url":"https://api.github.com/repos/scrnhq/laravel-bakery/contents/{+path}","compare_url":"https://api.github.com/repos/scrnhq/laravel-bakery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scrnhq/laravel-bakery/merges","archive_url":"https://api.github.com/repos/scrnhq/laravel-bakery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scrnhq/laravel-bakery/downloads","issues_url":"https://api.github.com/repos/scrnhq/laravel-bakery/issues{/number}","pulls_url":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls{/number}","milestones_url":"https://api.github.com/repos/scrnhq/laravel-bakery/milestones{/number}","notifications_url":"https://api.github.com/repos/scrnhq/laravel-bakery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scrnhq/laravel-bakery/labels{/name}","releases_url":"https://api.github.com/repos/scrnhq/laravel-bakery/releases{/id}","deployments_url":"https://api.github.com/repos/scrnhq/laravel-bakery/deployments","created_at":"2017-11-03T18:07:39Z","updated_at":"2018-04-22T17:38:01Z","pushed_at":"2018-05-29T09:55:12Z","git_url":"git://github.com/scrnhq/laravel-bakery.git","ssh_url":"git@github.com:scrnhq/laravel-bakery.git","clone_url":"https://github.com/scrnhq/laravel-bakery.git","svn_url":"https://github.com/scrnhq/laravel-bakery","homepage":"","size":292,"stargazers_count":7,"watchers_count":7,"language":"PHP","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":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":9,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34"},"html":{"href":"https://github.com/scrnhq/laravel-bakery/pull/34"},"issue":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/34"},"comments":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/scrnhq/laravel-bakery/statuses/728ffd5a2a8796b36620001daa0ec89c4fbb4731"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codeclimate"}}