{"action":"created","comment":{"url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/comments/55133378","id":55133378,"diff_hunk":"@@ -0,0 +1,90 @@\n+defmodule GraphQL.Schema.SimpleBlog do\n+  alias GraphQL.Schema\n+  alias GraphQL.Type.ObjectType\n+  alias GraphQL.Type.List\n+  alias GraphQL.Type.NonNull\n+  alias GraphQL.Type.ID\n+  alias GraphQL.Type.String\n+  alias GraphQL.Type.Int\n+  alias GraphQL.Type.Boolean\n+\n+  defmodule Image do\n+    def type do\n+       %ObjectType{\n+        name: \"Image\",\n+        description: \"Images for an article or a profile picture\",\n+        fields: %{\n+          url: %{type: %String{}},\n+          width: %{type: %Int{}},\n+          height: %{type: %Int{}}\n+        }\n+      }\n+    end\n+  end\n+\n+  defmodule Author do\n+    def type do\n+      %ObjectType{\n+        name: \"Author\",\n+        description: \"Author of the blog, with their profile picture and latest article\",\n+        fields: %{\n+          id: %{type: %String{}},\n+          name: %{type: %String{}},\n+          pic: %{\n+            args: %{\n+              width: %{type: %Int{}},\n+              height: %{type: %Int{}}\n+            },\n+            type: Image.type,\n+            resolve: fn(o, %{width: w, height: h}, _) ->\n+              GraphQL.Schema.SimpleBlog.Data.Storage.get_pic(o.id, w, h)\n+            end\n+          }\n+        }\n+      }\n+    end\n+  end\n+\n+  defmodule Article do\n+    def type do\n+      %ObjectType{\n+        name: \"Article\",\n+        description: \"A blog post\",\n+        fields: %{\n+          id: %{type: %NonNull{ofType: %String{}}},\n+          isPublished: %{type: %Boolean{}},\n+          author: %{type: Author.type},\n+          title: %{type: %String{}},\n+          body: %{type: %String{}},\n+          keywords: %{type: %List{ofType: %String{}}}\n+        }\n+      }\n+    end\n+  end\n+\n+  defmodule Query do\n+    def type do\n+      %ObjectType{\n+        name: \"Query\",\n+        fields: %{\n+          article: %{\n+            type: %List{ofType: Article.type},\n+            args: %{id: %{type: %ID{}}},\n+            resolve: fn\n+              _, %{id: id}, _ -> [GraphQL.Schema.SimpleBlog.Data.Storage.get_article(id)]","path":"web/graphql/simple_blog/schema.ex","position":74,"original_position":74,"commit_id":"31529c3612bb5428dd9db4411789c2b4fce8ca57","original_commit_id":"31529c3612bb5428dd9db4411789c2b4fce8ca57","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":"parens please\r\n","created_at":"2016-03-06T05:11:02Z","updated_at":"2016-03-06T05:11:02Z","html_url":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13#discussion_r55133378","pull_request_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/comments/55133378"},"html":{"href":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13#discussion_r55133378"},"pull_request":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13","id":60291831,"html_url":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13","diff_url":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13.diff","patch_url":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13.patch","issue_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/13","number":13,"state":"open","locked":false,"title":"Refactoring blog schema and fixing pic function","user":{"login":"aweiker","id":38160,"avatar_url":"https://avatars.githubusercontent.com/u/38160?v=3","gravatar_id":"","url":"https://api.github.com/users/aweiker","html_url":"https://github.com/aweiker","followers_url":"https://api.github.com/users/aweiker/followers","following_url":"https://api.github.com/users/aweiker/following{/other_user}","gists_url":"https://api.github.com/users/aweiker/gists{/gist_id}","starred_url":"https://api.github.com/users/aweiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aweiker/subscriptions","organizations_url":"https://api.github.com/users/aweiker/orgs","repos_url":"https://api.github.com/users/aweiker/repos","events_url":"https://api.github.com/users/aweiker/events{/privacy}","received_events_url":"https://api.github.com/users/aweiker/received_events","type":"User","site_admin":false},"body":"This is some preliminary cleanup so that I can extend the schema to support mutations.\r\n\r\nThere was also a bug in the schema when retrieving pic data, this fixes that as well.","created_at":"2016-02-23T05:55:30Z","updated_at":"2016-03-06T05:11:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"145a809bd82591eaf6a69fcd4db1bd80d1dd4662","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13/commits","review_comments_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13/comments","review_comment_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/13/comments","statuses_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/statuses/31529c3612bb5428dd9db4411789c2b4fce8ca57","head":{"label":"aweiker:blog-schema-cleanup","ref":"blog-schema-cleanup","sha":"31529c3612bb5428dd9db4411789c2b4fce8ca57","user":{"login":"aweiker","id":38160,"avatar_url":"https://avatars.githubusercontent.com/u/38160?v=3","gravatar_id":"","url":"https://api.github.com/users/aweiker","html_url":"https://github.com/aweiker","followers_url":"https://api.github.com/users/aweiker/followers","following_url":"https://api.github.com/users/aweiker/following{/other_user}","gists_url":"https://api.github.com/users/aweiker/gists{/gist_id}","starred_url":"https://api.github.com/users/aweiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aweiker/subscriptions","organizations_url":"https://api.github.com/users/aweiker/orgs","repos_url":"https://api.github.com/users/aweiker/repos","events_url":"https://api.github.com/users/aweiker/events{/privacy}","received_events_url":"https://api.github.com/users/aweiker/received_events","type":"User","site_admin":false},"repo":{"id":52061522,"name":"hello_graphql_phoenix","full_name":"aweiker/hello_graphql_phoenix","owner":{"login":"aweiker","id":38160,"avatar_url":"https://avatars.githubusercontent.com/u/38160?v=3","gravatar_id":"","url":"https://api.github.com/users/aweiker","html_url":"https://github.com/aweiker","followers_url":"https://api.github.com/users/aweiker/followers","following_url":"https://api.github.com/users/aweiker/following{/other_user}","gists_url":"https://api.github.com/users/aweiker/gists{/gist_id}","starred_url":"https://api.github.com/users/aweiker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aweiker/subscriptions","organizations_url":"https://api.github.com/users/aweiker/orgs","repos_url":"https://api.github.com/users/aweiker/repos","events_url":"https://api.github.com/users/aweiker/events{/privacy}","received_events_url":"https://api.github.com/users/aweiker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aweiker/hello_graphql_phoenix","description":"Examples of GraphQL Elixir Plug endpoints mounted in Phoenix","fork":true,"url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix","forks_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/forks","keys_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/teams","hooks_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/hooks","issue_events_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/events","assignees_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/tags","blobs_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/languages","stargazers_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/stargazers","contributors_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/contributors","subscribers_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/subscribers","subscription_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/subscription","commits_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/merges","archive_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/downloads","issues_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/labels{/name}","releases_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/aweiker/hello_graphql_phoenix/deployments","created_at":"2016-02-19T04:33:33Z","updated_at":"2016-02-19T04:33:33Z","pushed_at":"2016-02-26T06:00:50Z","git_url":"git://github.com/aweiker/hello_graphql_phoenix.git","ssh_url":"git@github.com:aweiker/hello_graphql_phoenix.git","clone_url":"https://github.com/aweiker/hello_graphql_phoenix.git","svn_url":"https://github.com/aweiker/hello_graphql_phoenix","homepage":"http://playground.graphql-elixir.org","size":197,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"a65d89e613850546c5d75feee7568a8ad3e364f5","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":47444170,"name":"hello_graphql_phoenix","full_name":"graphql-elixir/hello_graphql_phoenix","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/hello_graphql_phoenix","description":"Examples of GraphQL Elixir Plug endpoints mounted in Phoenix","fork":false,"url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix","forks_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/forks","keys_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/teams","hooks_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/hooks","issue_events_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/events","assignees_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/tags","blobs_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/languages","stargazers_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/stargazers","contributors_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/contributors","subscribers_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/subscribers","subscription_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/subscription","commits_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/merges","archive_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/downloads","issues_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/labels{/name}","releases_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/releases{/id}","deployments_url":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/deployments","created_at":"2015-12-05T05:43:48Z","updated_at":"2016-03-06T00:22:44Z","pushed_at":"2016-03-06T05:00:28Z","git_url":"git://github.com/graphql-elixir/hello_graphql_phoenix.git","ssh_url":"git@github.com:graphql-elixir/hello_graphql_phoenix.git","clone_url":"https://github.com/graphql-elixir/hello_graphql_phoenix.git","svn_url":"https://github.com/graphql-elixir/hello_graphql_phoenix","homepage":"http://playground.graphql-elixir.org","size":186,"stargazers_count":28,"watchers_count":28,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":8,"forks":4,"open_issues":8,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13"},"html":{"href":"https://github.com/graphql-elixir/hello_graphql_phoenix/pull/13"},"issue":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/13"},"comments":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/graphql-elixir/hello_graphql_phoenix/statuses/31529c3612bb5428dd9db4411789c2b4fce8ca57"}}}}