{"action":"closed","number":66,"pull_request":{"url":"https://api.github.com/repos/andimarek/graphql-java/pulls/66","id":56695509,"html_url":"https://github.com/andimarek/graphql-java/pull/66","diff_url":"https://github.com/andimarek/graphql-java/pull/66.diff","patch_url":"https://github.com/andimarek/graphql-java/pull/66.patch","issue_url":"https://api.github.com/repos/andimarek/graphql-java/issues/66","number":66,"state":"closed","locked":false,"title":"overload .type to accept a callable/lambda","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"body":"Addresses #65\r\n\r\nI'm basically no good at Java, so this may have lots of problems with it. Conceptually this does make some sense to me.\r\n\r\nAs I can tell, Lambda implement something called FunctionalInterfaces. DataFetcher is one such FunctionalInterface that you have defined already.\r\n\r\n`Java.util.concurrent.Callable` is also a functional interface. It maps to a lambda that takes no arguments but returns a value.\r\n\r\nTherefore `Callable<GraphQLOutputType>` should be a lambda that returns a `GraphQLOutputType`.\r\n\r\nConceptually, this should let us do something like this to create recursive Object types.\r\n\r\n```\r\nGraphQLObjectType commentType = newObject()\r\n                        .name(\"Comment\")\r\n                        .field(newFieldDefinition()\r\n                                .type(() -> new GraphQLList(commentType))\r\n                                .name(\"replies\")\r\n                                .build())\r\n                        .build();\r\n```\r\n\r\nAs I said, I'm no good at Java, and there may be issues, but I do hope that this helps add support for recursive Objects. We need it badly.","created_at":"2016-01-21T01:57:01Z","updated_at":"2016-01-21T21:10:03Z","closed_at":"2016-01-21T21:10:03Z","merged_at":null,"merge_commit_sha":"6643953c8b5c4038d8208b5bade2ece40603a432","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andimarek/graphql-java/pulls/66/commits","review_comments_url":"https://api.github.com/repos/andimarek/graphql-java/pulls/66/comments","review_comment_url":"https://api.github.com/repos/andimarek/graphql-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andimarek/graphql-java/issues/66/comments","statuses_url":"https://api.github.com/repos/andimarek/graphql-java/statuses/c209c7190a357e2be38737939e1c1784503f8d74","head":{"label":"nmn:patch-1","ref":"patch-1","sha":"c209c7190a357e2be38737939e1c1784503f8d74","user":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"repo":{"id":50073726,"name":"graphql-java","full_name":"nmn/graphql-java","owner":{"login":"nmn","id":3582514,"avatar_url":"https://avatars.githubusercontent.com/u/3582514?v=3","gravatar_id":"","url":"https://api.github.com/users/nmn","html_url":"https://github.com/nmn","followers_url":"https://api.github.com/users/nmn/followers","following_url":"https://api.github.com/users/nmn/following{/other_user}","gists_url":"https://api.github.com/users/nmn/gists{/gist_id}","starred_url":"https://api.github.com/users/nmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmn/subscriptions","organizations_url":"https://api.github.com/users/nmn/orgs","repos_url":"https://api.github.com/users/nmn/repos","events_url":"https://api.github.com/users/nmn/events{/privacy}","received_events_url":"https://api.github.com/users/nmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmn/graphql-java","description":"GraphQL Java implementation","fork":true,"url":"https://api.github.com/repos/nmn/graphql-java","forks_url":"https://api.github.com/repos/nmn/graphql-java/forks","keys_url":"https://api.github.com/repos/nmn/graphql-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmn/graphql-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmn/graphql-java/teams","hooks_url":"https://api.github.com/repos/nmn/graphql-java/hooks","issue_events_url":"https://api.github.com/repos/nmn/graphql-java/issues/events{/number}","events_url":"https://api.github.com/repos/nmn/graphql-java/events","assignees_url":"https://api.github.com/repos/nmn/graphql-java/assignees{/user}","branches_url":"https://api.github.com/repos/nmn/graphql-java/branches{/branch}","tags_url":"https://api.github.com/repos/nmn/graphql-java/tags","blobs_url":"https://api.github.com/repos/nmn/graphql-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmn/graphql-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmn/graphql-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmn/graphql-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmn/graphql-java/statuses/{sha}","languages_url":"https://api.github.com/repos/nmn/graphql-java/languages","stargazers_url":"https://api.github.com/repos/nmn/graphql-java/stargazers","contributors_url":"https://api.github.com/repos/nmn/graphql-java/contributors","subscribers_url":"https://api.github.com/repos/nmn/graphql-java/subscribers","subscription_url":"https://api.github.com/repos/nmn/graphql-java/subscription","commits_url":"https://api.github.com/repos/nmn/graphql-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmn/graphql-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmn/graphql-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmn/graphql-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmn/graphql-java/contents/{+path}","compare_url":"https://api.github.com/repos/nmn/graphql-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmn/graphql-java/merges","archive_url":"https://api.github.com/repos/nmn/graphql-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmn/graphql-java/downloads","issues_url":"https://api.github.com/repos/nmn/graphql-java/issues{/number}","pulls_url":"https://api.github.com/repos/nmn/graphql-java/pulls{/number}","milestones_url":"https://api.github.com/repos/nmn/graphql-java/milestones{/number}","notifications_url":"https://api.github.com/repos/nmn/graphql-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmn/graphql-java/labels{/name}","releases_url":"https://api.github.com/repos/nmn/graphql-java/releases{/id}","created_at":"2016-01-21T01:41:20Z","updated_at":"2016-01-21T01:41:21Z","pushed_at":"2016-01-21T01:55:18Z","git_url":"git://github.com/nmn/graphql-java.git","ssh_url":"git@github.com:nmn/graphql-java.git","clone_url":"https://github.com/nmn/graphql-java.git","svn_url":"https://github.com/nmn/graphql-java","homepage":"","size":553,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"andimarek:master","ref":"master","sha":"9e237e997d802f5267348c4934d59afd503b5d1c","user":{"login":"andimarek","id":1706744,"avatar_url":"https://avatars.githubusercontent.com/u/1706744?v=3","gravatar_id":"","url":"https://api.github.com/users/andimarek","html_url":"https://github.com/andimarek","followers_url":"https://api.github.com/users/andimarek/followers","following_url":"https://api.github.com/users/andimarek/following{/other_user}","gists_url":"https://api.github.com/users/andimarek/gists{/gist_id}","starred_url":"https://api.github.com/users/andimarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andimarek/subscriptions","organizations_url":"https://api.github.com/users/andimarek/orgs","repos_url":"https://api.github.com/users/andimarek/repos","events_url":"https://api.github.com/users/andimarek/events{/privacy}","received_events_url":"https://api.github.com/users/andimarek/received_events","type":"User","site_admin":false},"repo":{"id":38602457,"name":"graphql-java","full_name":"andimarek/graphql-java","owner":{"login":"andimarek","id":1706744,"avatar_url":"https://avatars.githubusercontent.com/u/1706744?v=3","gravatar_id":"","url":"https://api.github.com/users/andimarek","html_url":"https://github.com/andimarek","followers_url":"https://api.github.com/users/andimarek/followers","following_url":"https://api.github.com/users/andimarek/following{/other_user}","gists_url":"https://api.github.com/users/andimarek/gists{/gist_id}","starred_url":"https://api.github.com/users/andimarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andimarek/subscriptions","organizations_url":"https://api.github.com/users/andimarek/orgs","repos_url":"https://api.github.com/users/andimarek/repos","events_url":"https://api.github.com/users/andimarek/events{/privacy}","received_events_url":"https://api.github.com/users/andimarek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andimarek/graphql-java","description":"GraphQL Java implementation","fork":false,"url":"https://api.github.com/repos/andimarek/graphql-java","forks_url":"https://api.github.com/repos/andimarek/graphql-java/forks","keys_url":"https://api.github.com/repos/andimarek/graphql-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andimarek/graphql-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andimarek/graphql-java/teams","hooks_url":"https://api.github.com/repos/andimarek/graphql-java/hooks","issue_events_url":"https://api.github.com/repos/andimarek/graphql-java/issues/events{/number}","events_url":"https://api.github.com/repos/andimarek/graphql-java/events","assignees_url":"https://api.github.com/repos/andimarek/graphql-java/assignees{/user}","branches_url":"https://api.github.com/repos/andimarek/graphql-java/branches{/branch}","tags_url":"https://api.github.com/repos/andimarek/graphql-java/tags","blobs_url":"https://api.github.com/repos/andimarek/graphql-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andimarek/graphql-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andimarek/graphql-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/andimarek/graphql-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andimarek/graphql-java/statuses/{sha}","languages_url":"https://api.github.com/repos/andimarek/graphql-java/languages","stargazers_url":"https://api.github.com/repos/andimarek/graphql-java/stargazers","contributors_url":"https://api.github.com/repos/andimarek/graphql-java/contributors","subscribers_url":"https://api.github.com/repos/andimarek/graphql-java/subscribers","subscription_url":"https://api.github.com/repos/andimarek/graphql-java/subscription","commits_url":"https://api.github.com/repos/andimarek/graphql-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/andimarek/graphql-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/andimarek/graphql-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/andimarek/graphql-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/andimarek/graphql-java/contents/{+path}","compare_url":"https://api.github.com/repos/andimarek/graphql-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andimarek/graphql-java/merges","archive_url":"https://api.github.com/repos/andimarek/graphql-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andimarek/graphql-java/downloads","issues_url":"https://api.github.com/repos/andimarek/graphql-java/issues{/number}","pulls_url":"https://api.github.com/repos/andimarek/graphql-java/pulls{/number}","milestones_url":"https://api.github.com/repos/andimarek/graphql-java/milestones{/number}","notifications_url":"https://api.github.com/repos/andimarek/graphql-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andimarek/graphql-java/labels{/name}","releases_url":"https://api.github.com/repos/andimarek/graphql-java/releases{/id}","created_at":"2015-07-06T06:52:20Z","updated_at":"2016-01-21T19:01:51Z","pushed_at":"2016-01-21T05:53:00Z","git_url":"git://github.com/andimarek/graphql-java.git","ssh_url":"git@github.com:andimarek/graphql-java.git","clone_url":"https://github.com/andimarek/graphql-java.git","svn_url":"https://github.com/andimarek/graphql-java","homepage":"","size":595,"stargazers_count":287,"watchers_count":287,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":19,"forks":42,"open_issues":19,"watchers":287,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andimarek/graphql-java/pulls/66"},"html":{"href":"https://github.com/andimarek/graphql-java/pull/66"},"issue":{"href":"https://api.github.com/repos/andimarek/graphql-java/issues/66"},"comments":{"href":"https://api.github.com/repos/andimarek/graphql-java/issues/66/comments"},"review_comments":{"href":"https://api.github.com/repos/andimarek/graphql-java/pulls/66/comments"},"review_comment":{"href":"https://api.github.com/repos/andimarek/graphql-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andimarek/graphql-java/pulls/66/commits"},"statuses":{"href":"https://api.github.com/repos/andimarek/graphql-java/statuses/c209c7190a357e2be38737939e1c1784503f8d74"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":2,"review_comments":0,"commits":1,"additions":17,"deletions":2,"changed_files":1}}