{"action":"created","issue":{"url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/9","labels_url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/9/comments","events_url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/9/events","html_url":"https://github.com/graphql/graphql-relay-js/issues/9","id":101294805,"number":9,"title":"Make `typeResolver` optional in `nodeDefinitions`","user":{"login":"mhart","id":367936,"avatar_url":"https://avatars.githubusercontent.com/u/367936?v=3","gravatar_id":"","url":"https://api.github.com/users/mhart","html_url":"https://github.com/mhart","followers_url":"https://api.github.com/users/mhart/followers","following_url":"https://api.github.com/users/mhart/following{/other_user}","gists_url":"https://api.github.com/users/mhart/gists{/gist_id}","starred_url":"https://api.github.com/users/mhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhart/subscriptions","organizations_url":"https://api.github.com/users/mhart/orgs","repos_url":"https://api.github.com/users/mhart/repos","events_url":"https://api.github.com/users/mhart/events{/privacy}","received_events_url":"https://api.github.com/users/mhart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"dschafer","id":2760005,"avatar_url":"https://avatars.githubusercontent.com/u/2760005?v=3","gravatar_id":"","url":"https://api.github.com/users/dschafer","html_url":"https://github.com/dschafer","followers_url":"https://api.github.com/users/dschafer/followers","following_url":"https://api.github.com/users/dschafer/following{/other_user}","gists_url":"https://api.github.com/users/dschafer/gists{/gist_id}","starred_url":"https://api.github.com/users/dschafer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschafer/subscriptions","organizations_url":"https://api.github.com/users/dschafer/orgs","repos_url":"https://api.github.com/users/dschafer/repos","events_url":"https://api.github.com/users/dschafer/events{/privacy}","received_events_url":"https://api.github.com/users/dschafer/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-16T20:00:01Z","updated_at":"2015-08-18T18:52:31Z","closed_at":null,"body":"AFAICT `graphql-js` allows you to leave out `resolveType` here:\r\n\r\nhttps://github.com/graphql/graphql-js/blob/a149b89a3047f38750eaade1f220eb1317eb9217/src/type/definition.js#L684-L685\r\n\r\nIn which case it will fall back to using `getTypeOf`/`isTypeOf`\r\n\r\nThe problem is, `nodeDefinitions` doesn't seem to allow you to leave out the `typeResolver` function:\r\n\r\nhttps://github.com/graphql/graphql-relay-js/blob/3dd1fc334879716e034f6a9583a13813959b0a8f/src/node/node.js#L55\r\n\r\nMaking this optional would certainly reduce a lot of boilerplate code"},"comment":{"url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/comments/132317066","html_url":"https://github.com/graphql/graphql-relay-js/issues/9#issuecomment-132317066","issue_url":"https://api.github.com/repos/graphql/graphql-relay-js/issues/9","id":132317066,"user":{"login":"dschafer","id":2760005,"avatar_url":"https://avatars.githubusercontent.com/u/2760005?v=3","gravatar_id":"","url":"https://api.github.com/users/dschafer","html_url":"https://github.com/dschafer","followers_url":"https://api.github.com/users/dschafer/followers","following_url":"https://api.github.com/users/dschafer/following{/other_user}","gists_url":"https://api.github.com/users/dschafer/gists{/gist_id}","starred_url":"https://api.github.com/users/dschafer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschafer/subscriptions","organizations_url":"https://api.github.com/users/dschafer/orgs","repos_url":"https://api.github.com/users/dschafer/repos","events_url":"https://api.github.com/users/dschafer/events{/privacy}","received_events_url":"https://api.github.com/users/dschafer/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T18:52:31Z","updated_at":"2015-08-18T18:52:31Z","body":"Yep, good call, we should do this."}}