{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/188","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/188/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/188/events","html_url":"https://github.com/silverstripe/silverstripe-graphql/pull/188","id":367428149,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwODY3OTIy","number":188,"title":"API Scaffolders can now be more expressive when registering fields","user":{"login":"ScopeyNZ","id":3260989,"node_id":"MDQ6VXNlcjMyNjA5ODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3260989?v=4","gravatar_id":"","url":"https://api.github.com/users/ScopeyNZ","html_url":"https://github.com/ScopeyNZ","followers_url":"https://api.github.com/users/ScopeyNZ/followers","following_url":"https://api.github.com/users/ScopeyNZ/following{/other_user}","gists_url":"https://api.github.com/users/ScopeyNZ/gists{/gist_id}","starred_url":"https://api.github.com/users/ScopeyNZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScopeyNZ/subscriptions","organizations_url":"https://api.github.com/users/ScopeyNZ/orgs","repos_url":"https://api.github.com/users/ScopeyNZ/repos","events_url":"https://api.github.com/users/ScopeyNZ/events{/privacy}","received_events_url":"https://api.github.com/users/ScopeyNZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"maxime-rainville","id":1168676,"node_id":"MDQ6VXNlcjExNjg2NzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1168676?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime-rainville","html_url":"https://github.com/maxime-rainville","followers_url":"https://api.github.com/users/maxime-rainville/followers","following_url":"https://api.github.com/users/maxime-rainville/following{/other_user}","gists_url":"https://api.github.com/users/maxime-rainville/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime-rainville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime-rainville/subscriptions","organizations_url":"https://api.github.com/users/maxime-rainville/orgs","repos_url":"https://api.github.com/users/maxime-rainville/repos","events_url":"https://api.github.com/users/maxime-rainville/events{/privacy}","received_events_url":"https://api.github.com/users/maxime-rainville/received_events","type":"User","site_admin":false},"assignees":[{"login":"maxime-rainville","id":1168676,"node_id":"MDQ6VXNlcjExNjg2NzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1168676?v=4","gravatar_id":"","url":"https://api.github.com/users/maxime-rainville","html_url":"https://github.com/maxime-rainville","followers_url":"https://api.github.com/users/maxime-rainville/followers","following_url":"https://api.github.com/users/maxime-rainville/following{/other_user}","gists_url":"https://api.github.com/users/maxime-rainville/gists{/gist_id}","starred_url":"https://api.github.com/users/maxime-rainville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxime-rainville/subscriptions","organizations_url":"https://api.github.com/users/maxime-rainville/orgs","repos_url":"https://api.github.com/users/maxime-rainville/repos","events_url":"https://api.github.com/users/maxime-rainville/events{/privacy}","received_events_url":"https://api.github.com/users/maxime-rainville/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-10-06T06:13:34Z","updated_at":"2018-12-02T23:07:31Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/pulls/188","html_url":"https://github.com/silverstripe/silverstripe-graphql/pull/188","diff_url":"https://github.com/silverstripe/silverstripe-graphql/pull/188.diff","patch_url":"https://github.com/silverstripe/silverstripe-graphql/pull/188.patch"},"body":"This adds the ability to register a new `FieldDefinition` when adding fields with a scaffolder. This means you can explicitly specify the type AND the resolver for the field rather than relying on it's resolution through the field type of the field on the dataobject.\r\n\r\nPart of the reasoning for this PR is it allows scaffolders to define types (ie. boolean, text, int) rather than using `->obj` which falls back to \"text\" for everything that has no casting (or `$db`) defined. Eg:\r\n\r\n```\r\n$scaffolder->addField('MethodAccess', Type::bool(), function($obj) { \r\n     return $obj->myMethod();\r\n}\r\n```\r\n\r\nThis PR also tidies up how the fields are retained within the scaffolder, rather than being a non-associative array and then making sure the array is distinct on the field name, I updated it to just be associative by field name. Slight performance gain I suspect.\r\n\r\nFixes #162"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/comments/443551168","html_url":"https://github.com/silverstripe/silverstripe-graphql/pull/188#issuecomment-443551168","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-graphql/issues/188","id":443551168,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzU1MTE2OA==","user":{"login":"robbieaverill","id":5170590,"node_id":"MDQ6VXNlcjUxNzA1OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/5170590?v=4","gravatar_id":"","url":"https://api.github.com/users/robbieaverill","html_url":"https://github.com/robbieaverill","followers_url":"https://api.github.com/users/robbieaverill/followers","following_url":"https://api.github.com/users/robbieaverill/following{/other_user}","gists_url":"https://api.github.com/users/robbieaverill/gists{/gist_id}","starred_url":"https://api.github.com/users/robbieaverill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbieaverill/subscriptions","organizations_url":"https://api.github.com/users/robbieaverill/orgs","repos_url":"https://api.github.com/users/robbieaverill/repos","events_url":"https://api.github.com/users/robbieaverill/events{/privacy}","received_events_url":"https://api.github.com/users/robbieaverill/received_events","type":"User","site_admin":false},"created_at":"2018-12-02T23:07:31Z","updated_at":"2018-12-02T23:07:31Z","author_association":"MEMBER","body":">I don't have access to this repo for some reason so I can't link PR (nor edit the issue to mention a PR)\r\n\r\nCore team should, I've fixed that"}}
{"actor":{"display_login":"robbieaverill"}}