{"action":"created","comment":{"url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/comments/196490873","pull_request_review_id":130053318,"id":196490873,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjQ5MDg3Mw==","diff_hunk":"@@ -130,7 +130,7 @@ public static function get_query_args( $source, array $args, AppContext $context\n \t\t\t\t\t$query_args['object_ids'] = $source->ID;\n \t\t\t\t\tbreak;\n \t\t\t\tcase $source instanceof \\WP_Term:\n-\t\t\t\t\t$query_args['object_ids'] = $GLOBALS['post']->ID;\n+\t\t\t\t\t$query_args['object_ids'] = $GLOBALS['post'] ? $GLOBALS['post']->ID : null;","path":"src/Type/TermObject/Connection/TermObjectConnectionResolver.php","position":5,"original_position":5,"commit_id":"a460a926b9641b79ad336b9a41f287b843bd5d34","original_commit_id":"a460a926b9641b79ad336b9a41f287b843bd5d34","user":{"login":"jasonbahl","id":1260765,"node_id":"MDQ6VXNlcjEyNjA3NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/1260765?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonbahl","html_url":"https://github.com/jasonbahl","followers_url":"https://api.github.com/users/jasonbahl/followers","following_url":"https://api.github.com/users/jasonbahl/following{/other_user}","gists_url":"https://api.github.com/users/jasonbahl/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonbahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonbahl/subscriptions","organizations_url":"https://api.github.com/users/jasonbahl/orgs","repos_url":"https://api.github.com/users/jasonbahl/repos","events_url":"https://api.github.com/users/jasonbahl/events{/privacy}","received_events_url":"https://api.github.com/users/jasonbahl/received_events","type":"User","site_admin":false},"body":"I like this change. Maybe let's make it a little more safe and make sure the global $post has an ID as well, just in cases something other than a Post was set as the global Post, which is unfortunately a possibility: \r\n\r\nSomething like:\r\n```\r\n$query_args['object_ids'] = is_a( $GLOBALS['post'], 'WP_Post' ) ? $GLOBALS['post']->ID : null;\r\n```","created_at":"2018-06-19T16:17:43Z","updated_at":"2018-06-19T16:18:41Z","html_url":"https://github.com/wp-graphql/wp-graphql/pull/459#discussion_r196490873","pull_request_url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/comments/196490873"},"html":{"href":"https://github.com/wp-graphql/wp-graphql/pull/459#discussion_r196490873"},"pull_request":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459"}}},"pull_request":{"url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459","id":195838368,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1ODM4MzY4","html_url":"https://github.com/wp-graphql/wp-graphql/pull/459","diff_url":"https://github.com/wp-graphql/wp-graphql/pull/459.diff","patch_url":"https://github.com/wp-graphql/wp-graphql/pull/459.patch","issue_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/459","number":459,"state":"open","locked":false,"title":"Bug when querying categories children","user":{"login":"ElisaMassafra","id":29998724,"node_id":"MDQ6VXNlcjI5OTk4NzI0","avatar_url":"https://avatars3.githubusercontent.com/u/29998724?v=4","gravatar_id":"","url":"https://api.github.com/users/ElisaMassafra","html_url":"https://github.com/ElisaMassafra","followers_url":"https://api.github.com/users/ElisaMassafra/followers","following_url":"https://api.github.com/users/ElisaMassafra/following{/other_user}","gists_url":"https://api.github.com/users/ElisaMassafra/gists{/gist_id}","starred_url":"https://api.github.com/users/ElisaMassafra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElisaMassafra/subscriptions","organizations_url":"https://api.github.com/users/ElisaMassafra/orgs","repos_url":"https://api.github.com/users/ElisaMassafra/repos","events_url":"https://api.github.com/users/ElisaMassafra/events{/privacy}","received_events_url":"https://api.github.com/users/ElisaMassafra/received_events","type":"User","site_admin":false},"body":"When querying categories children it throws an error as $GLOBALS['post'] is null.\r\nQuery example:\r\ncategories {\r\n    nodes {\r\n      slug\r\n      children {\r\n        nodes {\r\n          slug\r\n        }\r\n      }\r\n    }\r\n  }\r\n\r\n### Your checklist for this pull request\r\nThanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.\r\n\r\n🚨Please review the [guidelines for contributing](../CONTRIBUTING.md) to this repository.\r\n\r\n- [x] Make sure you are making a pull request against the **develop branch** (left side). Also you should start *your branch* off *our develop*.\r\n- [ ] Make sure you are requesting to pull request from a **topic/feature/bugfix branch** (right side). Don't pull request from your master!\r\n\r\nWhat does this implement/fix? Explain your changes.\r\n---------------------------------------------------\r\n…\r\n\r\n\r\nDoes this close any currently open issues?\r\n------------------------------------------\r\n…\r\n\r\n\r\nAny relevant logs, error output, GraphiQL screenshots, etc?\r\n-------------------------------------\r\n(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)\r\n\r\n\r\nAny other comments?\r\n-------------------\r\n…\r\n\r\n\r\nWhere has this been tested?\r\n---------------------------\r\n**Operating System:** …\r\n\r\n**WordPress Version:** …\r\n","created_at":"2018-06-19T14:01:09Z","updated_at":"2018-06-19T16:18:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c2ce7b6d589fdfea649ce9201c71b996ea8f1c3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459/commits","review_comments_url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459/comments","review_comment_url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/459/comments","statuses_url":"https://api.github.com/repos/wp-graphql/wp-graphql/statuses/a460a926b9641b79ad336b9a41f287b843bd5d34","head":{"label":"ElisaMassafra:patch-2","ref":"patch-2","sha":"a460a926b9641b79ad336b9a41f287b843bd5d34","user":{"login":"ElisaMassafra","id":29998724,"node_id":"MDQ6VXNlcjI5OTk4NzI0","avatar_url":"https://avatars3.githubusercontent.com/u/29998724?v=4","gravatar_id":"","url":"https://api.github.com/users/ElisaMassafra","html_url":"https://github.com/ElisaMassafra","followers_url":"https://api.github.com/users/ElisaMassafra/followers","following_url":"https://api.github.com/users/ElisaMassafra/following{/other_user}","gists_url":"https://api.github.com/users/ElisaMassafra/gists{/gist_id}","starred_url":"https://api.github.com/users/ElisaMassafra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElisaMassafra/subscriptions","organizations_url":"https://api.github.com/users/ElisaMassafra/orgs","repos_url":"https://api.github.com/users/ElisaMassafra/repos","events_url":"https://api.github.com/users/ElisaMassafra/events{/privacy}","received_events_url":"https://api.github.com/users/ElisaMassafra/received_events","type":"User","site_admin":false},"repo":{"id":129207101,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkyMDcxMDE=","name":"wp-graphql","full_name":"ElisaMassafra/wp-graphql","owner":{"login":"ElisaMassafra","id":29998724,"node_id":"MDQ6VXNlcjI5OTk4NzI0","avatar_url":"https://avatars3.githubusercontent.com/u/29998724?v=4","gravatar_id":"","url":"https://api.github.com/users/ElisaMassafra","html_url":"https://github.com/ElisaMassafra","followers_url":"https://api.github.com/users/ElisaMassafra/followers","following_url":"https://api.github.com/users/ElisaMassafra/following{/other_user}","gists_url":"https://api.github.com/users/ElisaMassafra/gists{/gist_id}","starred_url":"https://api.github.com/users/ElisaMassafra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElisaMassafra/subscriptions","organizations_url":"https://api.github.com/users/ElisaMassafra/orgs","repos_url":"https://api.github.com/users/ElisaMassafra/repos","events_url":"https://api.github.com/users/ElisaMassafra/events{/privacy}","received_events_url":"https://api.github.com/users/ElisaMassafra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ElisaMassafra/wp-graphql","description":"A GraphQL API for WordPress","fork":true,"url":"https://api.github.com/repos/ElisaMassafra/wp-graphql","forks_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/forks","keys_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/teams","hooks_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/hooks","issue_events_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/issues/events{/number}","events_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/events","assignees_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/assignees{/user}","branches_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/branches{/branch}","tags_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/tags","blobs_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/languages","stargazers_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/stargazers","contributors_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/contributors","subscribers_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/subscribers","subscription_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/subscription","commits_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/contents/{+path}","compare_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/merges","archive_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/downloads","issues_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/issues{/number}","pulls_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/labels{/name}","releases_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/releases{/id}","deployments_url":"https://api.github.com/repos/ElisaMassafra/wp-graphql/deployments","created_at":"2018-04-12T06:56:38Z","updated_at":"2018-04-12T06:56:40Z","pushed_at":"2018-06-19T14:00:46Z","git_url":"git://github.com/ElisaMassafra/wp-graphql.git","ssh_url":"git@github.com:ElisaMassafra/wp-graphql.git","clone_url":"https://github.com/ElisaMassafra/wp-graphql.git","svn_url":"https://github.com/ElisaMassafra/wp-graphql","homepage":"https://www.wpgraphql.com","size":15716,"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":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"wp-graphql:develop","ref":"develop","sha":"26ce43d8228db1fd8e531171387989f219f6bd58","user":{"login":"wp-graphql","id":24994409,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTk0NDA5","avatar_url":"https://avatars0.githubusercontent.com/u/24994409?v=4","gravatar_id":"","url":"https://api.github.com/users/wp-graphql","html_url":"https://github.com/wp-graphql","followers_url":"https://api.github.com/users/wp-graphql/followers","following_url":"https://api.github.com/users/wp-graphql/following{/other_user}","gists_url":"https://api.github.com/users/wp-graphql/gists{/gist_id}","starred_url":"https://api.github.com/users/wp-graphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wp-graphql/subscriptions","organizations_url":"https://api.github.com/users/wp-graphql/orgs","repos_url":"https://api.github.com/users/wp-graphql/repos","events_url":"https://api.github.com/users/wp-graphql/events{/privacy}","received_events_url":"https://api.github.com/users/wp-graphql/received_events","type":"Organization","site_admin":false},"repo":{"id":72453516,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ1MzUxNg==","name":"wp-graphql","full_name":"wp-graphql/wp-graphql","owner":{"login":"wp-graphql","id":24994409,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0OTk0NDA5","avatar_url":"https://avatars0.githubusercontent.com/u/24994409?v=4","gravatar_id":"","url":"https://api.github.com/users/wp-graphql","html_url":"https://github.com/wp-graphql","followers_url":"https://api.github.com/users/wp-graphql/followers","following_url":"https://api.github.com/users/wp-graphql/following{/other_user}","gists_url":"https://api.github.com/users/wp-graphql/gists{/gist_id}","starred_url":"https://api.github.com/users/wp-graphql/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wp-graphql/subscriptions","organizations_url":"https://api.github.com/users/wp-graphql/orgs","repos_url":"https://api.github.com/users/wp-graphql/repos","events_url":"https://api.github.com/users/wp-graphql/events{/privacy}","received_events_url":"https://api.github.com/users/wp-graphql/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wp-graphql/wp-graphql","description":"A GraphQL API for WordPress","fork":false,"url":"https://api.github.com/repos/wp-graphql/wp-graphql","forks_url":"https://api.github.com/repos/wp-graphql/wp-graphql/forks","keys_url":"https://api.github.com/repos/wp-graphql/wp-graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wp-graphql/wp-graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wp-graphql/wp-graphql/teams","hooks_url":"https://api.github.com/repos/wp-graphql/wp-graphql/hooks","issue_events_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/events{/number}","events_url":"https://api.github.com/repos/wp-graphql/wp-graphql/events","assignees_url":"https://api.github.com/repos/wp-graphql/wp-graphql/assignees{/user}","branches_url":"https://api.github.com/repos/wp-graphql/wp-graphql/branches{/branch}","tags_url":"https://api.github.com/repos/wp-graphql/wp-graphql/tags","blobs_url":"https://api.github.com/repos/wp-graphql/wp-graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wp-graphql/wp-graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wp-graphql/wp-graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/wp-graphql/wp-graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wp-graphql/wp-graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/wp-graphql/wp-graphql/languages","stargazers_url":"https://api.github.com/repos/wp-graphql/wp-graphql/stargazers","contributors_url":"https://api.github.com/repos/wp-graphql/wp-graphql/contributors","subscribers_url":"https://api.github.com/repos/wp-graphql/wp-graphql/subscribers","subscription_url":"https://api.github.com/repos/wp-graphql/wp-graphql/subscription","commits_url":"https://api.github.com/repos/wp-graphql/wp-graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/wp-graphql/wp-graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/wp-graphql/wp-graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/wp-graphql/wp-graphql/contents/{+path}","compare_url":"https://api.github.com/repos/wp-graphql/wp-graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wp-graphql/wp-graphql/merges","archive_url":"https://api.github.com/repos/wp-graphql/wp-graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wp-graphql/wp-graphql/downloads","issues_url":"https://api.github.com/repos/wp-graphql/wp-graphql/issues{/number}","pulls_url":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/wp-graphql/wp-graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/wp-graphql/wp-graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wp-graphql/wp-graphql/labels{/name}","releases_url":"https://api.github.com/repos/wp-graphql/wp-graphql/releases{/id}","deployments_url":"https://api.github.com/repos/wp-graphql/wp-graphql/deployments","created_at":"2016-10-31T16:06:18Z","updated_at":"2018-06-18T07:11:07Z","pushed_at":"2018-06-19T14:01:09Z","git_url":"git://github.com/wp-graphql/wp-graphql.git","ssh_url":"git@github.com:wp-graphql/wp-graphql.git","clone_url":"https://github.com/wp-graphql/wp-graphql.git","svn_url":"https://github.com/wp-graphql/wp-graphql","homepage":"https://www.wpgraphql.com","size":15709,"stargazers_count":654,"watchers_count":654,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":83,"mirror_url":null,"archived":false,"open_issues_count":75,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":83,"open_issues":75,"watchers":654,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459"},"html":{"href":"https://github.com/wp-graphql/wp-graphql/pull/459"},"issue":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/459"},"comments":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/issues/459/comments"},"review_comments":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459/comments"},"review_comment":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/pulls/459/commits"},"statuses":{"href":"https://api.github.com/repos/wp-graphql/wp-graphql/statuses/a460a926b9641b79ad336b9a41f287b843bd5d34"}},"author_association":"NONE"}}
{"actor":{"display_login":"jasonbahl"}}