{"action":"created","comment":{"url":"https://api.github.com/repos/toptal/crystalball/pulls/comments/180486627","pull_request_review_id":110915114,"id":180486627,"diff_hunk":"@@ -0,0 +1,125 @@\n+# frozen_string_literal: true\n+\n+require 'crystalball/map_generator/base_strategy'\n+\n+module Crystalball\n+  module GraphQL\n+    module MapGenerator\n+      # Map generator strategy to build map of GraphQL type definitions\n+      # that might affect an example.\n+      # Patches `GraphQL::ObjectType.define` to get the path of files that call it.\n+      class GraphQLStrategy\n+        include ::Crystalball::MapGenerator::BaseStrategy\n+        include ::Crystalball::MapGenerator::Helpers::PathFilter\n+\n+        class << self\n+          attr_accessor :current_schema, :type_definition_paths, :patch_applied\n+\n+          # Adds the type definition paths of each of the `other_keys`\n+          # to the type definition paths of `key`\n+          def augment_type_definition_paths(key, other_keys)\n+            type_definition_paths[key.object_id] |= other_keys\n+                                                    .map { |t| type_definition_paths[t.object_id] }\n+                                                    .flatten\n+                                                    .compact\n+          end\n+\n+          # Checks whether `::GraphQL::Schema` is defined and, if it is, applies\n+          # the patch to it. It needs to be this way because `graphql` gem is weird.\n+          def apply_patch","path":"lib/crystalball/graphql/map_generator/graphql_strategy.rb","position":29,"original_position":29,"commit_id":"70c38a3047f8a95e3206f68b18380ed8e3abe3a5","original_commit_id":"70c38a3047f8a95e3206f68b18380ed8e3abe3a5","user":{"login":"jaimerson","id":2944985,"avatar_url":"https://avatars0.githubusercontent.com/u/2944985?v=4","gravatar_id":"","url":"https://api.github.com/users/jaimerson","html_url":"https://github.com/jaimerson","followers_url":"https://api.github.com/users/jaimerson/followers","following_url":"https://api.github.com/users/jaimerson/following{/other_user}","gists_url":"https://api.github.com/users/jaimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimerson/subscriptions","organizations_url":"https://api.github.com/users/jaimerson/orgs","repos_url":"https://api.github.com/users/jaimerson/repos","events_url":"https://api.github.com/users/jaimerson/events{/privacy}","received_events_url":"https://api.github.com/users/jaimerson/received_events","type":"User","site_admin":false},"body":"GraphQL specs break when we require it in this file. I'll just keep the bang version to be called during `#call` where we're sure `graphql` has been loaded already.","created_at":"2018-04-10T16:31:57Z","updated_at":"2018-04-10T16:31:57Z","html_url":"https://github.com/toptal/crystalball/pull/56#discussion_r180486627","pull_request_url":"https://api.github.com/repos/toptal/crystalball/pulls/56","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/comments/180486627"},"html":{"href":"https://github.com/toptal/crystalball/pull/56#discussion_r180486627"},"pull_request":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/56"}},"in_reply_to_id":180192685},"pull_request":{"url":"https://api.github.com/repos/toptal/crystalball/pulls/56","id":176785707,"html_url":"https://github.com/toptal/crystalball/pull/56","diff_url":"https://github.com/toptal/crystalball/pull/56.diff","patch_url":"https://github.com/toptal/crystalball/pull/56.patch","issue_url":"https://api.github.com/repos/toptal/crystalball/issues/56","number":56,"state":"open","locked":false,"title":"Create GraphQL map generation strategy","user":{"login":"jaimerson","id":2944985,"avatar_url":"https://avatars0.githubusercontent.com/u/2944985?v=4","gravatar_id":"","url":"https://api.github.com/users/jaimerson","html_url":"https://github.com/jaimerson","followers_url":"https://api.github.com/users/jaimerson/followers","following_url":"https://api.github.com/users/jaimerson/following{/other_user}","gists_url":"https://api.github.com/users/jaimerson/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimerson/subscriptions","organizations_url":"https://api.github.com/users/jaimerson/orgs","repos_url":"https://api.github.com/users/jaimerson/repos","events_url":"https://api.github.com/users/jaimerson/events{/privacy}","received_events_url":"https://api.github.com/users/jaimerson/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-03-22T13:55:20Z","updated_at":"2018-04-10T16:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04c5ec269d04ba3d4473ec02c755097128d822fb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/toptal/crystalball/pulls/56/commits","review_comments_url":"https://api.github.com/repos/toptal/crystalball/pulls/56/comments","review_comment_url":"https://api.github.com/repos/toptal/crystalball/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toptal/crystalball/issues/56/comments","statuses_url":"https://api.github.com/repos/toptal/crystalball/statuses/70c38a3047f8a95e3206f68b18380ed8e3abe3a5","head":{"label":"toptal:cb-70-create-graphql-strategy","ref":"cb-70-create-graphql-strategy","sha":"70c38a3047f8a95e3206f68b18380ed8e3abe3a5","user":{"login":"toptal","id":4004158,"avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"repo":{"id":87081635,"name":"crystalball","full_name":"toptal/crystalball","owner":{"login":"toptal","id":4004158,"avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toptal/crystalball","description":"Regression Test Selection library for your Ruby test suite","fork":false,"url":"https://api.github.com/repos/toptal/crystalball","forks_url":"https://api.github.com/repos/toptal/crystalball/forks","keys_url":"https://api.github.com/repos/toptal/crystalball/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toptal/crystalball/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toptal/crystalball/teams","hooks_url":"https://api.github.com/repos/toptal/crystalball/hooks","issue_events_url":"https://api.github.com/repos/toptal/crystalball/issues/events{/number}","events_url":"https://api.github.com/repos/toptal/crystalball/events","assignees_url":"https://api.github.com/repos/toptal/crystalball/assignees{/user}","branches_url":"https://api.github.com/repos/toptal/crystalball/branches{/branch}","tags_url":"https://api.github.com/repos/toptal/crystalball/tags","blobs_url":"https://api.github.com/repos/toptal/crystalball/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toptal/crystalball/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toptal/crystalball/git/refs{/sha}","trees_url":"https://api.github.com/repos/toptal/crystalball/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toptal/crystalball/statuses/{sha}","languages_url":"https://api.github.com/repos/toptal/crystalball/languages","stargazers_url":"https://api.github.com/repos/toptal/crystalball/stargazers","contributors_url":"https://api.github.com/repos/toptal/crystalball/contributors","subscribers_url":"https://api.github.com/repos/toptal/crystalball/subscribers","subscription_url":"https://api.github.com/repos/toptal/crystalball/subscription","commits_url":"https://api.github.com/repos/toptal/crystalball/commits{/sha}","git_commits_url":"https://api.github.com/repos/toptal/crystalball/git/commits{/sha}","comments_url":"https://api.github.com/repos/toptal/crystalball/comments{/number}","issue_comment_url":"https://api.github.com/repos/toptal/crystalball/issues/comments{/number}","contents_url":"https://api.github.com/repos/toptal/crystalball/contents/{+path}","compare_url":"https://api.github.com/repos/toptal/crystalball/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toptal/crystalball/merges","archive_url":"https://api.github.com/repos/toptal/crystalball/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toptal/crystalball/downloads","issues_url":"https://api.github.com/repos/toptal/crystalball/issues{/number}","pulls_url":"https://api.github.com/repos/toptal/crystalball/pulls{/number}","milestones_url":"https://api.github.com/repos/toptal/crystalball/milestones{/number}","notifications_url":"https://api.github.com/repos/toptal/crystalball/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toptal/crystalball/labels{/name}","releases_url":"https://api.github.com/repos/toptal/crystalball/releases{/id}","deployments_url":"https://api.github.com/repos/toptal/crystalball/deployments","created_at":"2017-04-03T14:10:50Z","updated_at":"2018-04-09T12:17:19Z","pushed_at":"2018-04-10T14:35:26Z","git_url":"git://github.com/toptal/crystalball.git","ssh_url":"git@github.com:toptal/crystalball.git","clone_url":"https://github.com/toptal/crystalball.git","svn_url":"https://github.com/toptal/crystalball","homepage":null,"size":240,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"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"},"forks":2,"open_issues":2,"watchers":20,"default_branch":"master"}},"base":{"label":"toptal:master","ref":"master","sha":"9581a1124942794f053dfea714910ac9049fa601","user":{"login":"toptal","id":4004158,"avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"repo":{"id":87081635,"name":"crystalball","full_name":"toptal/crystalball","owner":{"login":"toptal","id":4004158,"avatar_url":"https://avatars1.githubusercontent.com/u/4004158?v=4","gravatar_id":"","url":"https://api.github.com/users/toptal","html_url":"https://github.com/toptal","followers_url":"https://api.github.com/users/toptal/followers","following_url":"https://api.github.com/users/toptal/following{/other_user}","gists_url":"https://api.github.com/users/toptal/gists{/gist_id}","starred_url":"https://api.github.com/users/toptal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toptal/subscriptions","organizations_url":"https://api.github.com/users/toptal/orgs","repos_url":"https://api.github.com/users/toptal/repos","events_url":"https://api.github.com/users/toptal/events{/privacy}","received_events_url":"https://api.github.com/users/toptal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/toptal/crystalball","description":"Regression Test Selection library for your Ruby test suite","fork":false,"url":"https://api.github.com/repos/toptal/crystalball","forks_url":"https://api.github.com/repos/toptal/crystalball/forks","keys_url":"https://api.github.com/repos/toptal/crystalball/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toptal/crystalball/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toptal/crystalball/teams","hooks_url":"https://api.github.com/repos/toptal/crystalball/hooks","issue_events_url":"https://api.github.com/repos/toptal/crystalball/issues/events{/number}","events_url":"https://api.github.com/repos/toptal/crystalball/events","assignees_url":"https://api.github.com/repos/toptal/crystalball/assignees{/user}","branches_url":"https://api.github.com/repos/toptal/crystalball/branches{/branch}","tags_url":"https://api.github.com/repos/toptal/crystalball/tags","blobs_url":"https://api.github.com/repos/toptal/crystalball/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toptal/crystalball/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toptal/crystalball/git/refs{/sha}","trees_url":"https://api.github.com/repos/toptal/crystalball/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toptal/crystalball/statuses/{sha}","languages_url":"https://api.github.com/repos/toptal/crystalball/languages","stargazers_url":"https://api.github.com/repos/toptal/crystalball/stargazers","contributors_url":"https://api.github.com/repos/toptal/crystalball/contributors","subscribers_url":"https://api.github.com/repos/toptal/crystalball/subscribers","subscription_url":"https://api.github.com/repos/toptal/crystalball/subscription","commits_url":"https://api.github.com/repos/toptal/crystalball/commits{/sha}","git_commits_url":"https://api.github.com/repos/toptal/crystalball/git/commits{/sha}","comments_url":"https://api.github.com/repos/toptal/crystalball/comments{/number}","issue_comment_url":"https://api.github.com/repos/toptal/crystalball/issues/comments{/number}","contents_url":"https://api.github.com/repos/toptal/crystalball/contents/{+path}","compare_url":"https://api.github.com/repos/toptal/crystalball/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toptal/crystalball/merges","archive_url":"https://api.github.com/repos/toptal/crystalball/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toptal/crystalball/downloads","issues_url":"https://api.github.com/repos/toptal/crystalball/issues{/number}","pulls_url":"https://api.github.com/repos/toptal/crystalball/pulls{/number}","milestones_url":"https://api.github.com/repos/toptal/crystalball/milestones{/number}","notifications_url":"https://api.github.com/repos/toptal/crystalball/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toptal/crystalball/labels{/name}","releases_url":"https://api.github.com/repos/toptal/crystalball/releases{/id}","deployments_url":"https://api.github.com/repos/toptal/crystalball/deployments","created_at":"2017-04-03T14:10:50Z","updated_at":"2018-04-09T12:17:19Z","pushed_at":"2018-04-10T14:35:26Z","git_url":"git://github.com/toptal/crystalball.git","ssh_url":"git@github.com:toptal/crystalball.git","clone_url":"https://github.com/toptal/crystalball.git","svn_url":"https://github.com/toptal/crystalball","homepage":null,"size":240,"stargazers_count":20,"watchers_count":20,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"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"},"forks":2,"open_issues":2,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/56"},"html":{"href":"https://github.com/toptal/crystalball/pull/56"},"issue":{"href":"https://api.github.com/repos/toptal/crystalball/issues/56"},"comments":{"href":"https://api.github.com/repos/toptal/crystalball/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toptal/crystalball/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/toptal/crystalball/statuses/70c38a3047f8a95e3206f68b18380ed8e3abe3a5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jaimerson"}}