{"action":"closed","number":1346,"pull_request":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346","id":174746429,"html_url":"https://github.com/rmosolgo/graphql-ruby/pull/1346","diff_url":"https://github.com/rmosolgo/graphql-ruby/pull/1346.diff","patch_url":"https://github.com/rmosolgo/graphql-ruby/pull/1346.patch","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1346","number":1346,"state":"closed","locked":false,"title":"[1.8] Add GraphQL::Schema::Interface.orphan_types configuration","user":{"login":"jturkel","id":2598096,"avatar_url":"https://avatars0.githubusercontent.com/u/2598096?v=4","gravatar_id":"","url":"https://api.github.com/users/jturkel","html_url":"https://github.com/jturkel","followers_url":"https://api.github.com/users/jturkel/followers","following_url":"https://api.github.com/users/jturkel/following{/other_user}","gists_url":"https://api.github.com/users/jturkel/gists{/gist_id}","starred_url":"https://api.github.com/users/jturkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jturkel/subscriptions","organizations_url":"https://api.github.com/users/jturkel/orgs","repos_url":"https://api.github.com/users/jturkel/repos","events_url":"https://api.github.com/users/jturkel/events{/privacy}","received_events_url":"https://api.github.com/users/jturkel/received_events","type":"User","site_admin":false},"body":"As discussed in #1335 this PR implements a method for registering \"orphaned\" interface implementations which leads to better encapsulation than registering this information with the schema:\r\n\r\n```ruby\r\n# Old way (but still supported)\r\nclass MySchema < GraphQL::Schema\r\n  mutation Types::MutationType\r\n  query Types::QueryType\r\n\r\n  orphan_types Types::CircleType, Types::SquareType\r\nend\r\n\r\n# New way\r\nclass Types::Shape < GraphQL::Schema::Interface\r\n  orphan_types Types::CircleType, Types::SquareType\r\nend\r\n```\r\n\r\nI went with the terminology \"orphan types\" vs. \"implementations\" to be consistent with the existing orphan types API on `GraphQL::Schema` and to avoid confusion about being required to register all implementations vs. just ones that are unreachable from the schema roots. This does introduce a cyclic dependency between the types and the interfaces they implement but Rails auto-loading or the appropriate require statements should handle this.\r\n\r\nThe implementation is a mix of code inspired (i.e. copied) from `GraphQL::Schema::Union.possible_types` and `GraphQL::Schema.orphan_types`. For consistency between `GraphQL::Schema::Union.possible_types`, `GraphQL::Schema::Interface.orphan_types` and `GraphQL::Schema.orphan_types` I modified `GraphQL::Schema.orphan_types` to accept either an array or splatted array.\r\n","created_at":"2018-03-13T18:12:44Z","updated_at":"2018-03-15T15:45:08Z","closed_at":"2018-03-15T15:45:08Z","merged_at":"2018-03-15T15:45:08Z","merge_commit_sha":"c9b6c129c236f8a99bb9805c071867d1028c6599","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346/commits","review_comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346/comments","review_comment_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1346/comments","statuses_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/cfdc1fb6660a581c43b7be25308a0a62a76461e8","head":{"label":"jturkel:feature/interface-implementations","ref":"feature/interface-implementations","sha":"cfdc1fb6660a581c43b7be25308a0a62a76461e8","user":{"login":"jturkel","id":2598096,"avatar_url":"https://avatars0.githubusercontent.com/u/2598096?v=4","gravatar_id":"","url":"https://api.github.com/users/jturkel","html_url":"https://github.com/jturkel","followers_url":"https://api.github.com/users/jturkel/followers","following_url":"https://api.github.com/users/jturkel/following{/other_user}","gists_url":"https://api.github.com/users/jturkel/gists{/gist_id}","starred_url":"https://api.github.com/users/jturkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jturkel/subscriptions","organizations_url":"https://api.github.com/users/jturkel/orgs","repos_url":"https://api.github.com/users/jturkel/repos","events_url":"https://api.github.com/users/jturkel/events{/privacy}","received_events_url":"https://api.github.com/users/jturkel/received_events","type":"User","site_admin":false},"repo":{"id":124758866,"name":"graphql-ruby","full_name":"jturkel/graphql-ruby","owner":{"login":"jturkel","id":2598096,"avatar_url":"https://avatars0.githubusercontent.com/u/2598096?v=4","gravatar_id":"","url":"https://api.github.com/users/jturkel","html_url":"https://github.com/jturkel","followers_url":"https://api.github.com/users/jturkel/followers","following_url":"https://api.github.com/users/jturkel/following{/other_user}","gists_url":"https://api.github.com/users/jturkel/gists{/gist_id}","starred_url":"https://api.github.com/users/jturkel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jturkel/subscriptions","organizations_url":"https://api.github.com/users/jturkel/orgs","repos_url":"https://api.github.com/users/jturkel/repos","events_url":"https://api.github.com/users/jturkel/events{/privacy}","received_events_url":"https://api.github.com/users/jturkel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jturkel/graphql-ruby","description":"Ruby implementation of GraphQL ","fork":true,"url":"https://api.github.com/repos/jturkel/graphql-ruby","forks_url":"https://api.github.com/repos/jturkel/graphql-ruby/forks","keys_url":"https://api.github.com/repos/jturkel/graphql-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jturkel/graphql-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jturkel/graphql-ruby/teams","hooks_url":"https://api.github.com/repos/jturkel/graphql-ruby/hooks","issue_events_url":"https://api.github.com/repos/jturkel/graphql-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/jturkel/graphql-ruby/events","assignees_url":"https://api.github.com/repos/jturkel/graphql-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/jturkel/graphql-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/jturkel/graphql-ruby/tags","blobs_url":"https://api.github.com/repos/jturkel/graphql-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jturkel/graphql-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jturkel/graphql-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/jturkel/graphql-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jturkel/graphql-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/jturkel/graphql-ruby/languages","stargazers_url":"https://api.github.com/repos/jturkel/graphql-ruby/stargazers","contributors_url":"https://api.github.com/repos/jturkel/graphql-ruby/contributors","subscribers_url":"https://api.github.com/repos/jturkel/graphql-ruby/subscribers","subscription_url":"https://api.github.com/repos/jturkel/graphql-ruby/subscription","commits_url":"https://api.github.com/repos/jturkel/graphql-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/jturkel/graphql-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/jturkel/graphql-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/jturkel/graphql-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/jturkel/graphql-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/jturkel/graphql-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jturkel/graphql-ruby/merges","archive_url":"https://api.github.com/repos/jturkel/graphql-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jturkel/graphql-ruby/downloads","issues_url":"https://api.github.com/repos/jturkel/graphql-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/jturkel/graphql-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/jturkel/graphql-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/jturkel/graphql-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jturkel/graphql-ruby/labels{/name}","releases_url":"https://api.github.com/repos/jturkel/graphql-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/jturkel/graphql-ruby/deployments","created_at":"2018-03-11T13:24:32Z","updated_at":"2018-03-11T13:24:35Z","pushed_at":"2018-03-15T14:23:00Z","git_url":"git://github.com/jturkel/graphql-ruby.git","ssh_url":"git@github.com:jturkel/graphql-ruby.git","clone_url":"https://github.com/jturkel/graphql-ruby.git","svn_url":"https://github.com/jturkel/graphql-ruby","homepage":"http://graphql-ruby.org","size":11075,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rmosolgo:1.8-dev","ref":"1.8-dev","sha":"a854205f1e3187180705ec485413a313b693811a","user":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars3.githubusercontent.com/u/2231765?v=4","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":true},"repo":{"id":30337170,"name":"graphql-ruby","full_name":"rmosolgo/graphql-ruby","owner":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars3.githubusercontent.com/u/2231765?v=4","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":true},"private":false,"html_url":"https://github.com/rmosolgo/graphql-ruby","description":"Ruby implementation of GraphQL ","fork":false,"url":"https://api.github.com/repos/rmosolgo/graphql-ruby","forks_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/forks","keys_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/teams","hooks_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/hooks","issue_events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/events","assignees_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/tags","blobs_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/languages","stargazers_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/stargazers","contributors_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/contributors","subscribers_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/subscribers","subscription_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/subscription","commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/merges","archive_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/downloads","issues_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/labels{/name}","releases_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/deployments","created_at":"2015-02-05T04:11:22Z","updated_at":"2018-03-15T14:25:18Z","pushed_at":"2018-03-15T15:45:08Z","git_url":"git://github.com/rmosolgo/graphql-ruby.git","ssh_url":"git@github.com:rmosolgo/graphql-ruby.git","clone_url":"https://github.com/rmosolgo/graphql-ruby.git","svn_url":"https://github.com/rmosolgo/graphql-ruby","homepage":"http://graphql-ruby.org","size":11061,"stargazers_count":2595,"watchers_count":2595,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":334,"mirror_url":null,"archived":false,"open_issues_count":123,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":334,"open_issues":123,"watchers":2595,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346"},"html":{"href":"https://github.com/rmosolgo/graphql-ruby/pull/1346"},"issue":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1346"},"comments":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1346/comments"},"review_comments":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346/comments"},"review_comment":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/pulls/1346/commits"},"statuses":{"href":"https://api.github.com/repos/rmosolgo/graphql-ruby/statuses/cfdc1fb6660a581c43b7be25308a0a62a76461e8"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"rmosolgo","id":2231765,"avatar_url":"https://avatars3.githubusercontent.com/u/2231765?v=4","gravatar_id":"","url":"https://api.github.com/users/rmosolgo","html_url":"https://github.com/rmosolgo","followers_url":"https://api.github.com/users/rmosolgo/followers","following_url":"https://api.github.com/users/rmosolgo/following{/other_user}","gists_url":"https://api.github.com/users/rmosolgo/gists{/gist_id}","starred_url":"https://api.github.com/users/rmosolgo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmosolgo/subscriptions","organizations_url":"https://api.github.com/users/rmosolgo/orgs","repos_url":"https://api.github.com/users/rmosolgo/repos","events_url":"https://api.github.com/users/rmosolgo/events{/privacy}","received_events_url":"https://api.github.com/users/rmosolgo/received_events","type":"User","site_admin":true},"comments":7,"review_comments":3,"maintainer_can_modify":false,"commits":1,"additions":94,"deletions":17,"changed_files":10}}
{"actor":{"display_login":"rmosolgo"}}