{"action":"created","comment":{"url":"https://api.github.com/repos/magento/graphql-ce/pulls/comments/238304074","pull_request_review_id":180810723,"id":238304074,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODMwNDA3NA==","diff_hunk":"@@ -0,0 +1,109 @@\n+<?php\n+/**\n+ * Copyright © Magento, Inc. All rights reserved.\n+ * See COPYING.txt for license details.\n+ */\n+declare(strict_types=1);\n+\n+namespace Magento\\CatalogGraphQl\\Model\\Resolver\\Products\\DataProvider\\Image;\n+\n+use Magento\\Catalog\\Model\\View\\Asset\\PlaceholderFactory;\n+use Magento\\Framework\\App\\Config\\ScopeConfigInterface;\n+use Magento\\Framework\\View\\Asset\\Repository as AssetRepository;\n+use Magento\\Framework\\View\\Design\\Theme\\ThemeProviderInterface;\n+use Magento\\Store\\Model\\StoreManagerInterface;\n+\n+/**\n+ * Class Placeholder\n+ * @package Magento\\CatalogGraphQl\\Model\\Resolver\\Products\\DataProvider\\Image\n+ */\n+class Placeholder\n+{\n+    /**\n+     * @var PlaceholderFactory\n+     */\n+    private $_placeholderFactory;\n+    /**\n+     * @var AssetRepository\n+     */\n+    private $_assetRepository;\n+    /**\n+     * @var ScopeConfigInterface\n+     */\n+    private $_scopeConfig;\n+    /**\n+     * @var StoreManagerInterface\n+     */\n+    private $_storeManager;\n+    /**\n+     * @var ThemeProviderInterface\n+     */\n+    private $_themeProvider;\n+\n+    /**\n+     * Placeholder constructor.\n+     * @param PlaceholderFactory $placeholderFactory\n+     * @param AssetRepository $assetRepository\n+     * @param ScopeConfigInterface $scopeConfig\n+     * @param StoreManagerInterface $storeManager\n+     * @param ThemeProviderInterface $themeProvider\n+     */\n+    public function __construct(\n+        PlaceholderFactory $placeholderFactory,\n+        AssetRepository $assetRepository,\n+        ScopeConfigInterface $scopeConfig,\n+        StoreManagerInterface $storeManager,\n+        ThemeProviderInterface $themeProvider\n+    ) {\n+        $this->_placeholderFactory = $placeholderFactory;\n+        $this->_assetRepository = $assetRepository;\n+        $this->_scopeConfig = $scopeConfig;\n+        $this->_storeManager = $storeManager;\n+        $this->_themeProvider = $themeProvider;\n+    }\n+\n+    /**\n+     * Get placeholder\n+     *\n+     * @param $imageType\n+     * @return string\n+     * @throws \\Magento\\Framework\\Exception\\NoSuchEntityException\n+     */\n+    public function getPlaceholder($imageType): string\n+    {\n+        $imageAsset = $this->_placeholderFactory->create(['type' => $imageType]);\n+\n+        // check if placeholder defined in config\n+        if ($imageAsset->getFilePath()) {\n+            return $imageAsset->getUrl();\n+        }\n+\n+        return $this->_assetRepository->createAsset(\n+            \"Magento_Catalog::images/product/placeholder/{$imageType}.jpg\",","path":"app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php","position":82,"original_position":82,"commit_id":"8867a57e773be7c63dc52e81d1add09ef7fda1fa","original_commit_id":"8867a57e773be7c63dc52e81d1add09ef7fda1fa","user":{"login":"naydav","id":537688,"node_id":"MDQ6VXNlcjUzNzY4OA==","avatar_url":"https://avatars1.githubusercontent.com/u/537688?v=4","gravatar_id":"","url":"https://api.github.com/users/naydav","html_url":"https://github.com/naydav","followers_url":"https://api.github.com/users/naydav/followers","following_url":"https://api.github.com/users/naydav/following{/other_user}","gists_url":"https://api.github.com/users/naydav/gists{/gist_id}","starred_url":"https://api.github.com/users/naydav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naydav/subscriptions","organizations_url":"https://api.github.com/users/naydav/orgs","repos_url":"https://api.github.com/users/naydav/repos","events_url":"https://api.github.com/users/naydav/events{/privacy}","received_events_url":"https://api.github.com/users/naydav/received_events","type":"User","site_admin":false},"body":"Need to check behavior if I changed default placeholder on some custom value via configuration","created_at":"2018-12-03T15:06:45Z","updated_at":"2018-12-03T15:06:46Z","html_url":"https://github.com/magento/graphql-ce/pull/245#discussion_r238304074","pull_request_url":"https://api.github.com/repos/magento/graphql-ce/pulls/245","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/comments/238304074"},"html":{"href":"https://github.com/magento/graphql-ce/pull/245#discussion_r238304074"},"pull_request":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/245"}}},"pull_request":{"url":"https://api.github.com/repos/magento/graphql-ce/pulls/245","id":229954725,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5OTU0NzI1","html_url":"https://github.com/magento/graphql-ce/pull/245","diff_url":"https://github.com/magento/graphql-ce/pull/245.diff","patch_url":"https://github.com/magento/graphql-ce/pull/245.patch","issue_url":"https://api.github.com/repos/magento/graphql-ce/issues/245","number":245,"state":"open","locked":false,"title":"Fix area for image placeholder in graphql response.","user":{"login":"VoronoyAlexandr","id":8229547,"node_id":"MDQ6VXNlcjgyMjk1NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/8229547?v=4","gravatar_id":"","url":"https://api.github.com/users/VoronoyAlexandr","html_url":"https://github.com/VoronoyAlexandr","followers_url":"https://api.github.com/users/VoronoyAlexandr/followers","following_url":"https://api.github.com/users/VoronoyAlexandr/following{/other_user}","gists_url":"https://api.github.com/users/VoronoyAlexandr/gists{/gist_id}","starred_url":"https://api.github.com/users/VoronoyAlexandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoronoyAlexandr/subscriptions","organizations_url":"https://api.github.com/users/VoronoyAlexandr/orgs","repos_url":"https://api.github.com/users/VoronoyAlexandr/repos","events_url":"https://api.github.com/users/VoronoyAlexandr/events{/privacy}","received_events_url":"https://api.github.com/users/VoronoyAlexandr/received_events","type":"User","site_admin":false},"body":"### Description (*)\r\nPR for issue #239 Fix resolving of image placeholder for Product without images.\r\nChanged area to \"frontend\" instead \"graphql\" for placeholder asset.\r\n\r\n### Fixed Issues (if relevant)\r\n\r\n1. magento/graphql-ce#239: Fix resolving of image placeholder for Product without images\r\n\r\n\r\n### Manual testing scenarios (*)\r\nRequest:\r\n```\r\n{\r\n  products (search: \"Test\") {\r\n    \r\n    items {\r\n        id\r\n        name\r\n      small_image {\r\n        url\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\nResponse:\r\n```\r\n{\r\n  \"data\": {\r\n    \"products\": {\r\n      \"items\": [\r\n        {\r\n          \"id\": 1201,\r\n          \"name\": \"Test\",\r\n          \"small_image\": {\r\n            \"url\": \"http://graphql-ce.loc/static/version1541944966/frontend/Magento/luma/en_US/Magento_Catalog/images/product/placeholder/small_image.jpg\"\r\n          }\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n\r\n\r\n### Contribution checklist (*)\r\n - [ ] Pull request has a meaningful description of its purpose\r\n - [ ] All commits are accompanied by meaningful commit messages\r\n - [ ] All new or changed code is covered with unit/integration tests (if applicable)\r\n - [ ] All automated tests passed successfully (all builds on Travis CI are green)\r\n","created_at":"2018-11-11T14:18:11Z","updated_at":"2018-12-03T15:06:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"368d491f2cbb69f5f01f223e96270dd538711eef","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":928142401,"node_id":"MDU6TGFiZWw5MjgxNDI0MDE=","url":"https://api.github.com/repos/magento/graphql-ce/labels/in-progress","name":"in-progress","color":"dd58a6","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/magento/graphql-ce/pulls/245/commits","review_comments_url":"https://api.github.com/repos/magento/graphql-ce/pulls/245/comments","review_comment_url":"https://api.github.com/repos/magento/graphql-ce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magento/graphql-ce/issues/245/comments","statuses_url":"https://api.github.com/repos/magento/graphql-ce/statuses/8867a57e773be7c63dc52e81d1add09ef7fda1fa","head":{"label":"VoronoyAlexandr:239_fix_resolving_of_image_placeholder_for_product_without_images","ref":"239_fix_resolving_of_image_placeholder_for_product_without_images","sha":"8867a57e773be7c63dc52e81d1add09ef7fda1fa","user":{"login":"VoronoyAlexandr","id":8229547,"node_id":"MDQ6VXNlcjgyMjk1NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/8229547?v=4","gravatar_id":"","url":"https://api.github.com/users/VoronoyAlexandr","html_url":"https://github.com/VoronoyAlexandr","followers_url":"https://api.github.com/users/VoronoyAlexandr/followers","following_url":"https://api.github.com/users/VoronoyAlexandr/following{/other_user}","gists_url":"https://api.github.com/users/VoronoyAlexandr/gists{/gist_id}","starred_url":"https://api.github.com/users/VoronoyAlexandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoronoyAlexandr/subscriptions","organizations_url":"https://api.github.com/users/VoronoyAlexandr/orgs","repos_url":"https://api.github.com/users/VoronoyAlexandr/repos","events_url":"https://api.github.com/users/VoronoyAlexandr/events{/privacy}","received_events_url":"https://api.github.com/users/VoronoyAlexandr/received_events","type":"User","site_admin":false},"repo":{"id":156448445,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY0NDg0NDU=","name":"graphql-ce","full_name":"VoronoyAlexandr/graphql-ce","private":false,"owner":{"login":"VoronoyAlexandr","id":8229547,"node_id":"MDQ6VXNlcjgyMjk1NDc=","avatar_url":"https://avatars3.githubusercontent.com/u/8229547?v=4","gravatar_id":"","url":"https://api.github.com/users/VoronoyAlexandr","html_url":"https://github.com/VoronoyAlexandr","followers_url":"https://api.github.com/users/VoronoyAlexandr/followers","following_url":"https://api.github.com/users/VoronoyAlexandr/following{/other_user}","gists_url":"https://api.github.com/users/VoronoyAlexandr/gists{/gist_id}","starred_url":"https://api.github.com/users/VoronoyAlexandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoronoyAlexandr/subscriptions","organizations_url":"https://api.github.com/users/VoronoyAlexandr/orgs","repos_url":"https://api.github.com/users/VoronoyAlexandr/repos","events_url":"https://api.github.com/users/VoronoyAlexandr/events{/privacy}","received_events_url":"https://api.github.com/users/VoronoyAlexandr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/VoronoyAlexandr/graphql-ce","description":"Magento 2 GraphQL community project","fork":true,"url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce","forks_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/forks","keys_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/teams","hooks_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/hooks","issue_events_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/issues/events{/number}","events_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/events","assignees_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/assignees{/user}","branches_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/branches{/branch}","tags_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/tags","blobs_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/statuses/{sha}","languages_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/languages","stargazers_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/stargazers","contributors_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/contributors","subscribers_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/subscribers","subscription_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/subscription","commits_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/contents/{+path}","compare_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/merges","archive_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/downloads","issues_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/issues{/number}","pulls_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/pulls{/number}","milestones_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/milestones{/number}","notifications_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/labels{/name}","releases_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/releases{/id}","deployments_url":"https://api.github.com/repos/VoronoyAlexandr/graphql-ce/deployments","created_at":"2018-11-06T21:12:21Z","updated_at":"2018-11-29T08:37:51Z","pushed_at":"2018-11-29T08:37:30Z","git_url":"git://github.com/VoronoyAlexandr/graphql-ce.git","ssh_url":"git@github.com:VoronoyAlexandr/graphql-ce.git","clone_url":"https://github.com/VoronoyAlexandr/graphql-ce.git","svn_url":"https://github.com/VoronoyAlexandr/graphql-ce","homepage":"","size":374683,"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":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.3-develop"}},"base":{"label":"magento:2.3-develop","ref":"2.3-develop","sha":"072ef373a4bd2e17f8989878b396b15d927c3895","user":{"login":"magento","id":168457,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODQ1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/168457?v=4","gravatar_id":"","url":"https://api.github.com/users/magento","html_url":"https://github.com/magento","followers_url":"https://api.github.com/users/magento/followers","following_url":"https://api.github.com/users/magento/following{/other_user}","gists_url":"https://api.github.com/users/magento/gists{/gist_id}","starred_url":"https://api.github.com/users/magento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento/subscriptions","organizations_url":"https://api.github.com/users/magento/orgs","repos_url":"https://api.github.com/users/magento/repos","events_url":"https://api.github.com/users/magento/events{/privacy}","received_events_url":"https://api.github.com/users/magento/received_events","type":"Organization","site_admin":false},"repo":{"id":128075669,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgwNzU2Njk=","name":"graphql-ce","full_name":"magento/graphql-ce","private":false,"owner":{"login":"magento","id":168457,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2ODQ1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/168457?v=4","gravatar_id":"","url":"https://api.github.com/users/magento","html_url":"https://github.com/magento","followers_url":"https://api.github.com/users/magento/followers","following_url":"https://api.github.com/users/magento/following{/other_user}","gists_url":"https://api.github.com/users/magento/gists{/gist_id}","starred_url":"https://api.github.com/users/magento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento/subscriptions","organizations_url":"https://api.github.com/users/magento/orgs","repos_url":"https://api.github.com/users/magento/repos","events_url":"https://api.github.com/users/magento/events{/privacy}","received_events_url":"https://api.github.com/users/magento/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/magento/graphql-ce","description":"Magento 2 GraphQL community project","fork":false,"url":"https://api.github.com/repos/magento/graphql-ce","forks_url":"https://api.github.com/repos/magento/graphql-ce/forks","keys_url":"https://api.github.com/repos/magento/graphql-ce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magento/graphql-ce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magento/graphql-ce/teams","hooks_url":"https://api.github.com/repos/magento/graphql-ce/hooks","issue_events_url":"https://api.github.com/repos/magento/graphql-ce/issues/events{/number}","events_url":"https://api.github.com/repos/magento/graphql-ce/events","assignees_url":"https://api.github.com/repos/magento/graphql-ce/assignees{/user}","branches_url":"https://api.github.com/repos/magento/graphql-ce/branches{/branch}","tags_url":"https://api.github.com/repos/magento/graphql-ce/tags","blobs_url":"https://api.github.com/repos/magento/graphql-ce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magento/graphql-ce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magento/graphql-ce/git/refs{/sha}","trees_url":"https://api.github.com/repos/magento/graphql-ce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magento/graphql-ce/statuses/{sha}","languages_url":"https://api.github.com/repos/magento/graphql-ce/languages","stargazers_url":"https://api.github.com/repos/magento/graphql-ce/stargazers","contributors_url":"https://api.github.com/repos/magento/graphql-ce/contributors","subscribers_url":"https://api.github.com/repos/magento/graphql-ce/subscribers","subscription_url":"https://api.github.com/repos/magento/graphql-ce/subscription","commits_url":"https://api.github.com/repos/magento/graphql-ce/commits{/sha}","git_commits_url":"https://api.github.com/repos/magento/graphql-ce/git/commits{/sha}","comments_url":"https://api.github.com/repos/magento/graphql-ce/comments{/number}","issue_comment_url":"https://api.github.com/repos/magento/graphql-ce/issues/comments{/number}","contents_url":"https://api.github.com/repos/magento/graphql-ce/contents/{+path}","compare_url":"https://api.github.com/repos/magento/graphql-ce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magento/graphql-ce/merges","archive_url":"https://api.github.com/repos/magento/graphql-ce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magento/graphql-ce/downloads","issues_url":"https://api.github.com/repos/magento/graphql-ce/issues{/number}","pulls_url":"https://api.github.com/repos/magento/graphql-ce/pulls{/number}","milestones_url":"https://api.github.com/repos/magento/graphql-ce/milestones{/number}","notifications_url":"https://api.github.com/repos/magento/graphql-ce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magento/graphql-ce/labels{/name}","releases_url":"https://api.github.com/repos/magento/graphql-ce/releases{/id}","deployments_url":"https://api.github.com/repos/magento/graphql-ce/deployments","created_at":"2018-04-04T14:38:53Z","updated_at":"2018-12-03T14:51:48Z","pushed_at":"2018-12-03T14:51:39Z","git_url":"git://github.com/magento/graphql-ce.git","ssh_url":"git@github.com:magento/graphql-ce.git","clone_url":"https://github.com/magento/graphql-ce.git","svn_url":"https://github.com/magento/graphql-ce","homepage":"","size":374756,"stargazers_count":60,"watchers_count":60,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"archived":false,"open_issues_count":114,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":70,"open_issues":114,"watchers":60,"default_branch":"2.3-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/245"},"html":{"href":"https://github.com/magento/graphql-ce/pull/245"},"issue":{"href":"https://api.github.com/repos/magento/graphql-ce/issues/245"},"comments":{"href":"https://api.github.com/repos/magento/graphql-ce/issues/245/comments"},"review_comments":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/245/comments"},"review_comment":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magento/graphql-ce/pulls/245/commits"},"statuses":{"href":"https://api.github.com/repos/magento/graphql-ce/statuses/8867a57e773be7c63dc52e81d1add09ef7fda1fa"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"naydav"}}