{"action":"created","comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/comments/167086600","pull_request_review_id":95255568,"id":167086600,"diff_hunk":"@@ -2,22 +2,23 @@\n \n namespace SilverStripe\\GraphQL\\Scaffolding\\Scaffolders\\CRUD;\n \n-use SilverStripe\\Core\\Extensible;\n+use Exception;\n+use GraphQL\\Type\\Definition\\InputObjectType;\n+use GraphQL\\Type\\Definition\\Type;\n+use SilverStripe\\Core\\Injector\\Injector;\n use SilverStripe\\GraphQL\\Manager;\n+use SilverStripe\\GraphQL\\Scaffolding\\Extensions\\TypeCreatorExtension;\n+use SilverStripe\\GraphQL\\Scaffolding\\Interfaces\\ResolverInterface;\n use SilverStripe\\GraphQL\\Scaffolding\\Scaffolders\\MutationScaffolder;\n use SilverStripe\\GraphQL\\Scaffolding\\Traits\\DataObjectTypeTrait;\n-use GraphQL\\Type\\Definition\\InputObjectType;\n-use SilverStripe\\Core\\Injector\\Injector;\n-use Exception;\n use SilverStripe\\ORM\\DataObject;\n use SilverStripe\\ORM\\DataObjectSchema;\n use SilverStripe\\ORM\\FieldType\\DBField;\n-use GraphQL\\Type\\Definition\\Type;\n \n /**\n  * A generic \"create\" operation for a DataObject.\n  */\n-class Create extends MutationScaffolder\n+class Create extends MutationScaffolder implements ResolverInterface","path":"src/Scaffolding/Scaffolders/CRUD/Create.php","position":26,"original_position":26,"commit_id":"a140e0656e840c89e2f2bae5e84513975c25ef2d","original_commit_id":"a140e0656e840c89e2f2bae5e84513975c25ef2d","user":{"login":"unclecheese","id":654636,"avatar_url":"https://avatars1.githubusercontent.com/u/654636?v=4","gravatar_id":"","url":"https://api.github.com/users/unclecheese","html_url":"https://github.com/unclecheese","followers_url":"https://api.github.com/users/unclecheese/followers","following_url":"https://api.github.com/users/unclecheese/following{/other_user}","gists_url":"https://api.github.com/users/unclecheese/gists{/gist_id}","starred_url":"https://api.github.com/users/unclecheese/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unclecheese/subscriptions","organizations_url":"https://api.github.com/users/unclecheese/orgs","repos_url":"https://api.github.com/users/unclecheese/repos","events_url":"https://api.github.com/users/unclecheese/events{/privacy}","received_events_url":"https://api.github.com/users/unclecheese/received_events","type":"User","site_admin":false},"body":"I really like the idea of replacing the explicit assignment of a closure with something more pluggable, but I'd much prefer that these scaffolded operations take a `ResolverInterface` as a dependency.\r\n\r\n```\r\nprivate static $dependencies = [ \r\n  'Resolver' => '%$SilverStripe\\GraphQL\\Scaffolding\\Interfaces\\ResolverInterface.read'\r\n];\r\n```\r\n\r\nIn addition to allowing the operation to be customisable without  subclassing, it seems more consistent with the change we're trying to make, which is to make customising operations much better. This would put us in a position to make the API more composable, e.g.\r\n\r\n```\r\nSilverStripe\\Core\\Injector\\Injector:\r\n  SilverStripe\\GraphQL\\Scaffolding\\Interfaces\\ResolverInterface.blogPostReadResolver\r\n    class: MyProject\\Resolvers\\MyBlogResolver\r\n  SilverStripe\\GraphQL\\Scaffolding\\Scaffolders\\CRUD\\Read.blogPost\r\n    properties:\r\n      Resolver: %$SilverStripe\\GraphQL\\Scaffolding\\Interfaces\\ResolverInterface.blogPostReadResolver\r\n\r\nScaffolding:\r\n  types:\r\n     BlogPost:\r\n       operations:\r\n          read:\r\n             service: SilverStripe\\GraphQL\\Scaffolding\\Scaffolders\\CRUD\\Read.blogPost     \r\n```\r\n\r\n... or something to that effect. Just a thought. ","created_at":"2018-02-08T22:24:33Z","updated_at":"2018-02-08T22:43:16Z","html_url":"https://github.com/silverstripe/silverstripe-graphql/pull/138#discussion_r167086600","pull_request_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/comments/167086600"},"html":{"href":"https://github.com/silverstripe/silverstripe-graphql/pull/138#discussion_r167086600"},"pull_request":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138"}}},"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138","id":167845469,"html_url":"https://github.com/silverstripe/silverstripe-graphql/pull/138","diff_url":"https://github.com/silverstripe/silverstripe-graphql/pull/138.diff","patch_url":"https://github.com/silverstripe/silverstripe-graphql/pull/138.patch","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/138","number":138,"state":"open","locked":false,"title":"BUG Fix broken createArgs() for scaffolded reads","user":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars2.githubusercontent.com/u/936064?v=4","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"body":"Fixes #137\r\n\r\nAfter this is merged, you can merge https://github.com/silverstripe/silverstripe-versioned/pull/111","created_at":"2018-02-08T00:15:44Z","updated_at":"2018-02-08T22:43:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eceabddafcb6d2c3e7e61945358ad48fb031051d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/milestones/10","html_url":"https://github.com/silverstripe/silverstripe-graphql/milestone/10","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/milestones/10/labels","id":2881995,"number":10,"title":"Recipe 4.1.0","description":"","creator":{"login":"chillu","id":111025,"avatar_url":"https://avatars3.githubusercontent.com/u/111025?v=4","gravatar_id":"","url":"https://api.github.com/users/chillu","html_url":"https://github.com/chillu","followers_url":"https://api.github.com/users/chillu/followers","following_url":"https://api.github.com/users/chillu/following{/other_user}","gists_url":"https://api.github.com/users/chillu/gists{/gist_id}","starred_url":"https://api.github.com/users/chillu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chillu/subscriptions","organizations_url":"https://api.github.com/users/chillu/orgs","repos_url":"https://api.github.com/users/chillu/repos","events_url":"https://api.github.com/users/chillu/events{/privacy}","received_events_url":"https://api.github.com/users/chillu/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":2,"state":"open","created_at":"2017-11-01T22:15:29Z","updated_at":"2018-02-08T00:16:30Z","due_on":"2018-01-30T08:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138/commits","review_comments_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138/comments","review_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/138/comments","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/statuses/a140e0656e840c89e2f2bae5e84513975c25ef2d","head":{"label":"open-sausages:pulls/1.1/fix-createargs","ref":"pulls/1.1/fix-createargs","sha":"a140e0656e840c89e2f2bae5e84513975c25ef2d","user":{"login":"open-sausages","id":12824172,"avatar_url":"https://avatars2.githubusercontent.com/u/12824172?v=4","gravatar_id":"","url":"https://api.github.com/users/open-sausages","html_url":"https://github.com/open-sausages","followers_url":"https://api.github.com/users/open-sausages/followers","following_url":"https://api.github.com/users/open-sausages/following{/other_user}","gists_url":"https://api.github.com/users/open-sausages/gists{/gist_id}","starred_url":"https://api.github.com/users/open-sausages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-sausages/subscriptions","organizations_url":"https://api.github.com/users/open-sausages/orgs","repos_url":"https://api.github.com/users/open-sausages/repos","events_url":"https://api.github.com/users/open-sausages/events{/privacy}","received_events_url":"https://api.github.com/users/open-sausages/received_events","type":"Organization","site_admin":false},"repo":{"id":76761541,"name":"silverstripe-graphql","full_name":"open-sausages/silverstripe-graphql","owner":{"login":"open-sausages","id":12824172,"avatar_url":"https://avatars2.githubusercontent.com/u/12824172?v=4","gravatar_id":"","url":"https://api.github.com/users/open-sausages","html_url":"https://github.com/open-sausages","followers_url":"https://api.github.com/users/open-sausages/followers","following_url":"https://api.github.com/users/open-sausages/following{/other_user}","gists_url":"https://api.github.com/users/open-sausages/gists{/gist_id}","starred_url":"https://api.github.com/users/open-sausages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-sausages/subscriptions","organizations_url":"https://api.github.com/users/open-sausages/orgs","repos_url":"https://api.github.com/users/open-sausages/repos","events_url":"https://api.github.com/users/open-sausages/events{/privacy}","received_events_url":"https://api.github.com/users/open-sausages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-sausages/silverstripe-graphql","description":"Serves SilverStripe data as GraphQL representations","fork":true,"url":"https://api.github.com/repos/open-sausages/silverstripe-graphql","forks_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/forks","keys_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/teams","hooks_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/hooks","issue_events_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/issues/events{/number}","events_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/events","assignees_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/assignees{/user}","branches_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/branches{/branch}","tags_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/tags","blobs_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/languages","stargazers_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/stargazers","contributors_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/contributors","subscribers_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/subscribers","subscription_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/subscription","commits_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/contents/{+path}","compare_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/merges","archive_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/downloads","issues_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/issues{/number}","pulls_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/labels{/name}","releases_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/releases{/id}","deployments_url":"https://api.github.com/repos/open-sausages/silverstripe-graphql/deployments","created_at":"2016-12-18T03:58:03Z","updated_at":"2016-12-18T03:58:04Z","pushed_at":"2018-02-08T02:50:40Z","git_url":"git://github.com/open-sausages/silverstripe-graphql.git","ssh_url":"git@github.com:open-sausages/silverstripe-graphql.git","clone_url":"https://github.com/open-sausages/silverstripe-graphql.git","svn_url":"https://github.com/open-sausages/silverstripe-graphql","homepage":null,"size":1318,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"silverstripe:1.1","ref":"1.1","sha":"d6f3693e279d5fcd0193c1827618c3b5a87b7641","user":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars0.githubusercontent.com/u/379348?v=4","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"repo":{"id":68341446,"name":"silverstripe-graphql","full_name":"silverstripe/silverstripe-graphql","owner":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars0.githubusercontent.com/u/379348?v=4","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silverstripe/silverstripe-graphql","description":"Serves SilverStripe data as GraphQL representations","fork":false,"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql","forks_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/forks","keys_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/teams","hooks_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/hooks","issue_events_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/events{/number}","events_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/events","assignees_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/assignees{/user}","branches_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/branches{/branch}","tags_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/tags","blobs_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/languages","stargazers_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/stargazers","contributors_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/contributors","subscribers_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/subscribers","subscription_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/subscription","commits_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/contents/{+path}","compare_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/merges","archive_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/downloads","issues_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues{/number}","pulls_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/labels{/name}","releases_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/releases{/id}","deployments_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/deployments","created_at":"2016-09-16T00:17:45Z","updated_at":"2018-02-08T19:34:37Z","pushed_at":"2018-02-08T02:50:41Z","git_url":"git://github.com/silverstripe/silverstripe-graphql.git","ssh_url":"git@github.com:silverstripe/silverstripe-graphql.git","clone_url":"https://github.com/silverstripe/silverstripe-graphql.git","svn_url":"https://github.com/silverstripe/silverstripe-graphql","homepage":null,"size":337,"stargazers_count":29,"watchers_count":29,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":15,"open_issues":28,"watchers":29,"default_branch":"1.0"}},"_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138"},"html":{"href":"https://github.com/silverstripe/silverstripe-graphql/pull/138"},"issue":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/138"},"comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/138/comments"},"review_comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138/comments"},"review_comment":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/138/commits"},"statuses":{"href":"https://api.github.com/repos/silverstripe/silverstripe-graphql/statuses/a140e0656e840c89e2f2bae5e84513975c25ef2d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"unclecheese"}}