{"action":"created","comment":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments/137133682","pull_request_review_id":60762058,"id":137133682,"diff_hunk":"@@ -0,0 +1,33 @@\n+const fs = require(`fs`)\n+const fetchData = require(`../fetch`)\n+\n+// Fetch data from our sample site and save it to disk.\n+\n+const typePrefix = `wordpress__`\n+const refactoredEntityTypes = {\n+  post: `${typePrefix}POST`,\n+  page: `${typePrefix}PAGE`,\n+  tag: `${typePrefix}TAG`,\n+  category: `${typePrefix}CATEGORY`,\n+}\n+\n+fetchData({\n+  _verbose: false,\n+  _siteURL: `http://dev-gatbsyjswp.pantheonsite.io`,\n+  baseUrl: `dev-gatbsyjswp.pantheonsite.io`,\n+  _useACF: true,\n+  _hostingWPCOM: false,\n+  auth: {","path":"packages/gatsby-source-wordpress/src/scripts/download-test-data.js","position":20,"original_position":20,"commit_id":"c38c05c9d6f38af6e21485c359f7c8526cff95a5","original_commit_id":"1cc914411189909e800ed470b59d5dd0f1096624","user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars3.githubusercontent.com/u/71047?v=4","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2017-09-05T22:45:28Z","updated_at":"2017-09-05T22:45:28Z","html_url":"https://github.com/gatsbyjs/gatsby/pull/1996#discussion_r137133682","pull_request_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments/137133682"},"html":{"href":"https://github.com/gatsbyjs/gatsby/pull/1996#discussion_r137133682"},"pull_request":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996"}},"in_reply_to_id":137063685},"pull_request":{"url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996","id":138998252,"html_url":"https://github.com/gatsbyjs/gatsby/pull/1996","diff_url":"https://github.com/gatsbyjs/gatsby/pull/1996.diff","patch_url":"https://github.com/gatsbyjs/gatsby/pull/1996.patch","issue_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1996","number":1996,"state":"open","locked":false,"title":"Download WordPress media & refactor node structures/linking & tests","user":{"login":"KyleAMathews","id":71047,"avatar_url":"https://avatars3.githubusercontent.com/u/71047?v=4","gravatar_id":"","url":"https://api.github.com/users/KyleAMathews","html_url":"https://github.com/KyleAMathews","followers_url":"https://api.github.com/users/KyleAMathews/followers","following_url":"https://api.github.com/users/KyleAMathews/following{/other_user}","gists_url":"https://api.github.com/users/KyleAMathews/gists{/gist_id}","starred_url":"https://api.github.com/users/KyleAMathews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KyleAMathews/subscriptions","organizations_url":"https://api.github.com/users/KyleAMathews/orgs","repos_url":"https://api.github.com/users/KyleAMathews/repos","events_url":"https://api.github.com/users/KyleAMathews/events{/privacy}","received_events_url":"https://api.github.com/users/KyleAMathews/received_events","type":"User","site_admin":false},"body":"* Use node streams when downloading remote files for efficieny\r\n* Download WordPress media\r\n\r\nYou can now query them like this:\r\n\r\n```graphql\r\n  query MediaQuery {\r\n    allWordpressWpMedia {\r\n      edges {\r\n        node {\r\n          id\r\n          source_url_local_file {\r\n            prettySize\r\n            childImageSharp {\r\n              responsiveResolution(width: 150, height: 100) {\r\n                width\r\n                height\r\n                src\r\n                srcSet\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n```\r\n\r\nKinda doubt `source_url_local_files` is the best name. Not really up to speed with WordPress' data structures yet. I think all media might be here and then other objects link to them. If that's the case, the field name could just be `file` or `local_file`.\r\n\r\nTODO still in future PR is to link other objects which references this post to the `File` node so you can easily write queries which jump from a page to their linked images.","created_at":"2017-09-02T03:31:27Z","updated_at":"2017-09-05T22:45:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4be172d1076f8f5277ad21b9e32ea8be9a0f6a91","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996/commits","review_comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996/comments","review_comment_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1996/comments","statuses_url":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/c38c05c9d6f38af6e21485c359f7c8526cff95a5","head":{"label":"gatsbyjs:dwnld-wp-images","ref":"dwnld-wp-images","sha":"c38c05c9d6f38af6e21485c359f7c8526cff95a5","user":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"repo":{"id":36040894,"name":"gatsby","full_name":"gatsbyjs/gatsby","owner":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gatsbyjs/gatsby","description":"⚛️📄🚀 Blazing fast static site generator for React","fork":false,"url":"https://api.github.com/repos/gatsbyjs/gatsby","forks_url":"https://api.github.com/repos/gatsbyjs/gatsby/forks","keys_url":"https://api.github.com/repos/gatsbyjs/gatsby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gatsbyjs/gatsby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gatsbyjs/gatsby/teams","hooks_url":"https://api.github.com/repos/gatsbyjs/gatsby/hooks","issue_events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/events{/number}","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/events","assignees_url":"https://api.github.com/repos/gatsbyjs/gatsby/assignees{/user}","branches_url":"https://api.github.com/repos/gatsbyjs/gatsby/branches{/branch}","tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/tags","blobs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/refs{/sha}","trees_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/{sha}","languages_url":"https://api.github.com/repos/gatsbyjs/gatsby/languages","stargazers_url":"https://api.github.com/repos/gatsbyjs/gatsby/stargazers","contributors_url":"https://api.github.com/repos/gatsbyjs/gatsby/contributors","subscribers_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscribers","subscription_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscription","commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/commits{/sha}","git_commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/commits{/sha}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/comments{/number}","issue_comment_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments{/number}","contents_url":"https://api.github.com/repos/gatsbyjs/gatsby/contents/{+path}","compare_url":"https://api.github.com/repos/gatsbyjs/gatsby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gatsbyjs/gatsby/merges","archive_url":"https://api.github.com/repos/gatsbyjs/gatsby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gatsbyjs/gatsby/downloads","issues_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues{/number}","pulls_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls{/number}","milestones_url":"https://api.github.com/repos/gatsbyjs/gatsby/milestones{/number}","notifications_url":"https://api.github.com/repos/gatsbyjs/gatsby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/labels{/name}","releases_url":"https://api.github.com/repos/gatsbyjs/gatsby/releases{/id}","deployments_url":"https://api.github.com/repos/gatsbyjs/gatsby/deployments","created_at":"2015-05-21T22:43:05Z","updated_at":"2017-09-05T22:36:48Z","pushed_at":"2017-09-05T22:42:34Z","git_url":"git://github.com/gatsbyjs/gatsby.git","ssh_url":"git@github.com:gatsbyjs/gatsby.git","clone_url":"https://github.com/gatsbyjs/gatsby.git","svn_url":"https://github.com/gatsbyjs/gatsby","homepage":"https://www.gatsbyjs.org","size":151207,"stargazers_count":12871,"watchers_count":12871,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":819,"mirror_url":null,"open_issues_count":298,"forks":819,"open_issues":298,"watchers":12871,"default_branch":"master"}},"base":{"label":"gatsbyjs:master","ref":"master","sha":"ca543dd2ac5a82fba990afa9b1597e9865439c09","user":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"repo":{"id":36040894,"name":"gatsby","full_name":"gatsbyjs/gatsby","owner":{"login":"gatsbyjs","id":12551863,"avatar_url":"https://avatars1.githubusercontent.com/u/12551863?v=4","gravatar_id":"","url":"https://api.github.com/users/gatsbyjs","html_url":"https://github.com/gatsbyjs","followers_url":"https://api.github.com/users/gatsbyjs/followers","following_url":"https://api.github.com/users/gatsbyjs/following{/other_user}","gists_url":"https://api.github.com/users/gatsbyjs/gists{/gist_id}","starred_url":"https://api.github.com/users/gatsbyjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatsbyjs/subscriptions","organizations_url":"https://api.github.com/users/gatsbyjs/orgs","repos_url":"https://api.github.com/users/gatsbyjs/repos","events_url":"https://api.github.com/users/gatsbyjs/events{/privacy}","received_events_url":"https://api.github.com/users/gatsbyjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gatsbyjs/gatsby","description":"⚛️📄🚀 Blazing fast static site generator for React","fork":false,"url":"https://api.github.com/repos/gatsbyjs/gatsby","forks_url":"https://api.github.com/repos/gatsbyjs/gatsby/forks","keys_url":"https://api.github.com/repos/gatsbyjs/gatsby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gatsbyjs/gatsby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gatsbyjs/gatsby/teams","hooks_url":"https://api.github.com/repos/gatsbyjs/gatsby/hooks","issue_events_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/events{/number}","events_url":"https://api.github.com/repos/gatsbyjs/gatsby/events","assignees_url":"https://api.github.com/repos/gatsbyjs/gatsby/assignees{/user}","branches_url":"https://api.github.com/repos/gatsbyjs/gatsby/branches{/branch}","tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/tags","blobs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/refs{/sha}","trees_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/{sha}","languages_url":"https://api.github.com/repos/gatsbyjs/gatsby/languages","stargazers_url":"https://api.github.com/repos/gatsbyjs/gatsby/stargazers","contributors_url":"https://api.github.com/repos/gatsbyjs/gatsby/contributors","subscribers_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscribers","subscription_url":"https://api.github.com/repos/gatsbyjs/gatsby/subscription","commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/commits{/sha}","git_commits_url":"https://api.github.com/repos/gatsbyjs/gatsby/git/commits{/sha}","comments_url":"https://api.github.com/repos/gatsbyjs/gatsby/comments{/number}","issue_comment_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues/comments{/number}","contents_url":"https://api.github.com/repos/gatsbyjs/gatsby/contents/{+path}","compare_url":"https://api.github.com/repos/gatsbyjs/gatsby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gatsbyjs/gatsby/merges","archive_url":"https://api.github.com/repos/gatsbyjs/gatsby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gatsbyjs/gatsby/downloads","issues_url":"https://api.github.com/repos/gatsbyjs/gatsby/issues{/number}","pulls_url":"https://api.github.com/repos/gatsbyjs/gatsby/pulls{/number}","milestones_url":"https://api.github.com/repos/gatsbyjs/gatsby/milestones{/number}","notifications_url":"https://api.github.com/repos/gatsbyjs/gatsby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gatsbyjs/gatsby/labels{/name}","releases_url":"https://api.github.com/repos/gatsbyjs/gatsby/releases{/id}","deployments_url":"https://api.github.com/repos/gatsbyjs/gatsby/deployments","created_at":"2015-05-21T22:43:05Z","updated_at":"2017-09-05T22:36:48Z","pushed_at":"2017-09-05T22:42:34Z","git_url":"git://github.com/gatsbyjs/gatsby.git","ssh_url":"git@github.com:gatsbyjs/gatsby.git","clone_url":"https://github.com/gatsbyjs/gatsby.git","svn_url":"https://github.com/gatsbyjs/gatsby","homepage":"https://www.gatsbyjs.org","size":151207,"stargazers_count":12871,"watchers_count":12871,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":819,"mirror_url":null,"open_issues_count":298,"forks":819,"open_issues":298,"watchers":12871,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996"},"html":{"href":"https://github.com/gatsbyjs/gatsby/pull/1996"},"issue":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1996"},"comments":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/issues/1996/comments"},"review_comments":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996/comments"},"review_comment":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/pulls/1996/commits"},"statuses":{"href":"https://api.github.com/repos/gatsbyjs/gatsby/statuses/c38c05c9d6f38af6e21485c359f7c8526cff95a5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"KyleAMathews"}}