{"action":"created","comment":{"url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/comments/56610072","id":56610072,"diff_hunk":"@@ -0,0 +1,43 @@\n+\n+defmodule GraphQL.Validation.Rules.UniqueOperationNames do\n+\n+  alias GraphQL.Lang.AST.Visitor\n+  alias GraphQL.Lang.AST.InitialisingVisitor\n+\n+  defstruct name: \"UniqueOperationNames\"\n+\n+  defimpl InitialisingVisitor do\n+    def init(_visitor, accumulator) do\n+      Map.merge(%{operation_names: %{}}, accumulator)\n+    end\n+  end\n+\n+  defimpl Visitor do\n+    def enter(_visitor, node, accumulator) do\n+      if node.kind == :OperationDefinition do\n+        if Map.has_key?(node, :name) do\n+          op_name = node.name\n+          if op_name.value do\n+            if accumulator[:operation_names][op_name.value] do","path":"lib/graphql/validation/rules/unique_operation_names.ex","position":21,"original_position":21,"commit_id":"22dec412ee6844e4da74dedc50c489ef82d1b159","original_commit_id":"365d810e3462f93e06a539f3710bbdf2a1946244","user":{"login":"joshprice","id":9307,"avatar_url":"https://avatars.githubusercontent.com/u/9307?v=3","gravatar_id":"","url":"https://api.github.com/users/joshprice","html_url":"https://github.com/joshprice","followers_url":"https://api.github.com/users/joshprice/followers","following_url":"https://api.github.com/users/joshprice/following{/other_user}","gists_url":"https://api.github.com/users/joshprice/gists{/gist_id}","starred_url":"https://api.github.com/users/joshprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshprice/subscriptions","organizations_url":"https://api.github.com/users/joshprice/orgs","repos_url":"https://api.github.com/users/joshprice/repos","events_url":"https://api.github.com/users/joshprice/events{/privacy}","received_events_url":"https://api.github.com/users/joshprice/received_events","type":"User","site_admin":false},"body":"4 nested `if`s need some extraction","created_at":"2016-03-18T03:38:03Z","updated_at":"2016-03-18T03:38:03Z","html_url":"https://github.com/graphql-elixir/graphql/pull/75#discussion_r56610072","pull_request_url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75","_links":{"self":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/comments/56610072"},"html":{"href":"https://github.com/graphql-elixir/graphql/pull/75#discussion_r56610072"},"pull_request":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75"}}},"pull_request":{"url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75","id":62770051,"html_url":"https://github.com/graphql-elixir/graphql/pull/75","diff_url":"https://github.com/graphql-elixir/graphql/pull/75.diff","patch_url":"https://github.com/graphql-elixir/graphql/pull/75.patch","issue_url":"https://api.github.com/repos/graphql-elixir/graphql/issues/75","number":75,"state":"open","locked":false,"title":"Validations/unique operation names","user":{"login":"freshtonic","id":2769,"avatar_url":"https://avatars.githubusercontent.com/u/2769?v=3","gravatar_id":"","url":"https://api.github.com/users/freshtonic","html_url":"https://github.com/freshtonic","followers_url":"https://api.github.com/users/freshtonic/followers","following_url":"https://api.github.com/users/freshtonic/following{/other_user}","gists_url":"https://api.github.com/users/freshtonic/gists{/gist_id}","starred_url":"https://api.github.com/users/freshtonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshtonic/subscriptions","organizations_url":"https://api.github.com/users/freshtonic/orgs","repos_url":"https://api.github.com/users/freshtonic/repos","events_url":"https://api.github.com/users/freshtonic/events{/privacy}","received_events_url":"https://api.github.com/users/freshtonic/received_events","type":"User","site_admin":false},"body":"I've created a validator that works with the AST visitor/reducer infrastructure.\r\n\r\nThis visitor is so simple that it does not need anything from the TypeInfoVisitor to do its job.\r\n\r\nI'm seeking feedback for anything and everything (overall approach, stylistic stuff etc). Don't hold back!\r\n\r\nParallelVisitor still needs tests (it's tested indirectly right now).\r\n\r\nNext I'd like to port `FieldsOnCorrectType` because that will exercise the `TypeInfoVisitor`. ","created_at":"2016-03-14T15:51:44Z","updated_at":"2016-03-18T03:38:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8ca760b56ecece3228b5d309be718dbfba3dae6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75/commits","review_comments_url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75/comments","review_comment_url":"https://api.github.com/repos/graphql-elixir/graphql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql-elixir/graphql/issues/75/comments","statuses_url":"https://api.github.com/repos/graphql-elixir/graphql/statuses/22dec412ee6844e4da74dedc50c489ef82d1b159","head":{"label":"freshtonic:validations/unique-operation-names","ref":"validations/unique-operation-names","sha":"22dec412ee6844e4da74dedc50c489ef82d1b159","user":{"login":"freshtonic","id":2769,"avatar_url":"https://avatars.githubusercontent.com/u/2769?v=3","gravatar_id":"","url":"https://api.github.com/users/freshtonic","html_url":"https://github.com/freshtonic","followers_url":"https://api.github.com/users/freshtonic/followers","following_url":"https://api.github.com/users/freshtonic/following{/other_user}","gists_url":"https://api.github.com/users/freshtonic/gists{/gist_id}","starred_url":"https://api.github.com/users/freshtonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshtonic/subscriptions","organizations_url":"https://api.github.com/users/freshtonic/orgs","repos_url":"https://api.github.com/users/freshtonic/repos","events_url":"https://api.github.com/users/freshtonic/events{/privacy}","received_events_url":"https://api.github.com/users/freshtonic/received_events","type":"User","site_admin":false},"repo":{"id":41619124,"name":"graphql-elixir","full_name":"freshtonic/graphql-elixir","owner":{"login":"freshtonic","id":2769,"avatar_url":"https://avatars.githubusercontent.com/u/2769?v=3","gravatar_id":"","url":"https://api.github.com/users/freshtonic","html_url":"https://github.com/freshtonic","followers_url":"https://api.github.com/users/freshtonic/followers","following_url":"https://api.github.com/users/freshtonic/following{/other_user}","gists_url":"https://api.github.com/users/freshtonic/gists{/gist_id}","starred_url":"https://api.github.com/users/freshtonic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freshtonic/subscriptions","organizations_url":"https://api.github.com/users/freshtonic/orgs","repos_url":"https://api.github.com/users/freshtonic/repos","events_url":"https://api.github.com/users/freshtonic/events{/privacy}","received_events_url":"https://api.github.com/users/freshtonic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/freshtonic/graphql-elixir","description":"GraphQL parser written in Elixir","fork":true,"url":"https://api.github.com/repos/freshtonic/graphql-elixir","forks_url":"https://api.github.com/repos/freshtonic/graphql-elixir/forks","keys_url":"https://api.github.com/repos/freshtonic/graphql-elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freshtonic/graphql-elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freshtonic/graphql-elixir/teams","hooks_url":"https://api.github.com/repos/freshtonic/graphql-elixir/hooks","issue_events_url":"https://api.github.com/repos/freshtonic/graphql-elixir/issues/events{/number}","events_url":"https://api.github.com/repos/freshtonic/graphql-elixir/events","assignees_url":"https://api.github.com/repos/freshtonic/graphql-elixir/assignees{/user}","branches_url":"https://api.github.com/repos/freshtonic/graphql-elixir/branches{/branch}","tags_url":"https://api.github.com/repos/freshtonic/graphql-elixir/tags","blobs_url":"https://api.github.com/repos/freshtonic/graphql-elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freshtonic/graphql-elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freshtonic/graphql-elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/freshtonic/graphql-elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freshtonic/graphql-elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/freshtonic/graphql-elixir/languages","stargazers_url":"https://api.github.com/repos/freshtonic/graphql-elixir/stargazers","contributors_url":"https://api.github.com/repos/freshtonic/graphql-elixir/contributors","subscribers_url":"https://api.github.com/repos/freshtonic/graphql-elixir/subscribers","subscription_url":"https://api.github.com/repos/freshtonic/graphql-elixir/subscription","commits_url":"https://api.github.com/repos/freshtonic/graphql-elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/freshtonic/graphql-elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/freshtonic/graphql-elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/freshtonic/graphql-elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/freshtonic/graphql-elixir/contents/{+path}","compare_url":"https://api.github.com/repos/freshtonic/graphql-elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freshtonic/graphql-elixir/merges","archive_url":"https://api.github.com/repos/freshtonic/graphql-elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freshtonic/graphql-elixir/downloads","issues_url":"https://api.github.com/repos/freshtonic/graphql-elixir/issues{/number}","pulls_url":"https://api.github.com/repos/freshtonic/graphql-elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/freshtonic/graphql-elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/freshtonic/graphql-elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freshtonic/graphql-elixir/labels{/name}","releases_url":"https://api.github.com/repos/freshtonic/graphql-elixir/releases{/id}","deployments_url":"https://api.github.com/repos/freshtonic/graphql-elixir/deployments","created_at":"2015-08-30T06:30:42Z","updated_at":"2016-03-02T09:22:58Z","pushed_at":"2016-03-18T03:37:51Z","git_url":"git://github.com/freshtonic/graphql-elixir.git","ssh_url":"git@github.com:freshtonic/graphql-elixir.git","clone_url":"https://github.com/freshtonic/graphql-elixir.git","svn_url":"https://github.com/freshtonic/graphql-elixir","homepage":"","size":436,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"graphql-elixir:master","ref":"master","sha":"e92c3e6079a553f14e13e0c5f4b011669ea2b040","user":{"login":"graphql-elixir","id":16552595,"avatar_url":"https://avatars.githubusercontent.com/u/16552595?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-elixir","html_url":"https://github.com/graphql-elixir","followers_url":"https://api.github.com/users/graphql-elixir/followers","following_url":"https://api.github.com/users/graphql-elixir/following{/other_user}","gists_url":"https://api.github.com/users/graphql-elixir/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-elixir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-elixir/subscriptions","organizations_url":"https://api.github.com/users/graphql-elixir/orgs","repos_url":"https://api.github.com/users/graphql-elixir/repos","events_url":"https://api.github.com/users/graphql-elixir/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-elixir/received_events","type":"Organization","site_admin":false},"repo":{"id":41307741,"name":"graphql","full_name":"graphql-elixir/graphql","owner":{"login":"graphql-elixir","id":16552595,"avatar_url":"https://avatars.githubusercontent.com/u/16552595?v=3","gravatar_id":"","url":"https://api.github.com/users/graphql-elixir","html_url":"https://github.com/graphql-elixir","followers_url":"https://api.github.com/users/graphql-elixir/followers","following_url":"https://api.github.com/users/graphql-elixir/following{/other_user}","gists_url":"https://api.github.com/users/graphql-elixir/gists{/gist_id}","starred_url":"https://api.github.com/users/graphql-elixir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphql-elixir/subscriptions","organizations_url":"https://api.github.com/users/graphql-elixir/orgs","repos_url":"https://api.github.com/users/graphql-elixir/repos","events_url":"https://api.github.com/users/graphql-elixir/events{/privacy}","received_events_url":"https://api.github.com/users/graphql-elixir/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphql-elixir/graphql","description":"GraphQL Elixir","fork":false,"url":"https://api.github.com/repos/graphql-elixir/graphql","forks_url":"https://api.github.com/repos/graphql-elixir/graphql/forks","keys_url":"https://api.github.com/repos/graphql-elixir/graphql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-elixir/graphql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-elixir/graphql/teams","hooks_url":"https://api.github.com/repos/graphql-elixir/graphql/hooks","issue_events_url":"https://api.github.com/repos/graphql-elixir/graphql/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-elixir/graphql/events","assignees_url":"https://api.github.com/repos/graphql-elixir/graphql/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-elixir/graphql/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-elixir/graphql/tags","blobs_url":"https://api.github.com/repos/graphql-elixir/graphql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-elixir/graphql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-elixir/graphql/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-elixir/graphql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-elixir/graphql/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-elixir/graphql/languages","stargazers_url":"https://api.github.com/repos/graphql-elixir/graphql/stargazers","contributors_url":"https://api.github.com/repos/graphql-elixir/graphql/contributors","subscribers_url":"https://api.github.com/repos/graphql-elixir/graphql/subscribers","subscription_url":"https://api.github.com/repos/graphql-elixir/graphql/subscription","commits_url":"https://api.github.com/repos/graphql-elixir/graphql/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-elixir/graphql/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-elixir/graphql/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-elixir/graphql/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-elixir/graphql/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-elixir/graphql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-elixir/graphql/merges","archive_url":"https://api.github.com/repos/graphql-elixir/graphql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-elixir/graphql/downloads","issues_url":"https://api.github.com/repos/graphql-elixir/graphql/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-elixir/graphql/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-elixir/graphql/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-elixir/graphql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-elixir/graphql/labels{/name}","releases_url":"https://api.github.com/repos/graphql-elixir/graphql/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-elixir/graphql/deployments","created_at":"2015-08-24T14:27:16Z","updated_at":"2016-03-18T03:34:47Z","pushed_at":"2016-03-18T03:37:51Z","git_url":"git://github.com/graphql-elixir/graphql.git","ssh_url":"git@github.com:graphql-elixir/graphql.git","clone_url":"https://github.com/graphql-elixir/graphql.git","svn_url":"https://github.com/graphql-elixir/graphql","homepage":"http://graphql-elixir.org","size":460,"stargazers_count":272,"watchers_count":272,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":12,"forks":29,"open_issues":12,"watchers":272,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75"},"html":{"href":"https://github.com/graphql-elixir/graphql/pull/75"},"issue":{"href":"https://api.github.com/repos/graphql-elixir/graphql/issues/75"},"comments":{"href":"https://api.github.com/repos/graphql-elixir/graphql/issues/75/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql-elixir/graphql/pulls/75/commits"},"statuses":{"href":"https://api.github.com/repos/graphql-elixir/graphql/statuses/22dec412ee6844e4da74dedc50c489ef82d1b159"}}}}