{"action":"created","comment":{"url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/comments/91309990","pull_request_review_id":11817900,"id":91309990,"diff_hunk":"@@ -0,0 +1,34 @@\n+# frozen_string_literal: true\n+module Decidim\n+  module Api\n+    # This type represents the root mutation type of the whole API\n+    MutationType = GraphQL::ObjectType.define do\n+      name \"Mutation\"\n+      description \"The root mutation of this schema\"\n+ \n+      # Every engine should be able to extend the root muation\n+      # so this code can be included on its own engine\n+      field :addComment, Decidim::Comments::CommentType do\n+        description \"Add a new comment to a commentable\"\n+        argument :commentableId, !types.String, \"The commentable's ID\"\n+        argument :commentableType, !types.String, \"The commentable's class name. i.e. `Decidim::ParticipatoryProcess`\"\n+        argument :body, !types.String, \"The comments's body\"\n+\n+        resolve ->(_obj, args, ctx) {\n+          commentable = args[:commentableType].constantize.find(args[:commentableId])\n+          form = Decidim::Comments::CommentForm.from_params({\n+                                                              \"comment\" => {\n+                                                                \"body\" => args[:body]\n+                                                              }\n+                                                            }, author: ctx[:current_user], commentable: commentable)\n+\n+          Decidim::Comments::CreateComment.call(form) do","path":"decidim-api/app/types/decidim/api/mutation_type.rb","position":25,"original_position":25,"commit_id":"077e132e633454c2d35ebcf095a5d7bcd130fcb8","original_commit_id":"a56f7feea1ea89a28965a02adb2fc11f26ec70f8","user":{"login":"beagleknight","id":106021,"avatar_url":"https://avatars.githubusercontent.com/u/106021?v=3","gravatar_id":"","url":"https://api.github.com/users/beagleknight","html_url":"https://github.com/beagleknight","followers_url":"https://api.github.com/users/beagleknight/followers","following_url":"https://api.github.com/users/beagleknight/following{/other_user}","gists_url":"https://api.github.com/users/beagleknight/gists{/gist_id}","starred_url":"https://api.github.com/users/beagleknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beagleknight/subscriptions","organizations_url":"https://api.github.com/users/beagleknight/orgs","repos_url":"https://api.github.com/users/beagleknight/repos","events_url":"https://api.github.com/users/beagleknight/events{/privacy}","received_events_url":"https://api.github.com/users/beagleknight/received_events","type":"User","site_admin":false},"body":"I think doing it into the command is the way to go in this project, right?","created_at":"2016-12-07T15:02:28Z","updated_at":"2016-12-07T15:02:29Z","html_url":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250#discussion_r91309990","pull_request_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250","_links":{"self":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/comments/91309990"},"html":{"href":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250#discussion_r91309990"},"pull_request":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250"}}},"pull_request":{"url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250","id":94170130,"html_url":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250","diff_url":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250.diff","patch_url":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250.patch","issue_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/250","number":250,"state":"open","locked":false,"title":"Add basic comments module","user":{"login":"beagleknight","id":106021,"avatar_url":"https://avatars.githubusercontent.com/u/106021?v=3","gravatar_id":"","url":"https://api.github.com/users/beagleknight","html_url":"https://github.com/beagleknight","followers_url":"https://api.github.com/users/beagleknight/followers","following_url":"https://api.github.com/users/beagleknight/following{/other_user}","gists_url":"https://api.github.com/users/beagleknight/gists{/gist_id}","starred_url":"https://api.github.com/users/beagleknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beagleknight/subscriptions","organizations_url":"https://api.github.com/users/beagleknight/orgs","repos_url":"https://api.github.com/users/beagleknight/repos","events_url":"https://api.github.com/users/beagleknight/events{/privacy}","received_events_url":"https://api.github.com/users/beagleknight/received_events","type":"User","site_admin":false},"body":"#### :tophat: What? Why?\r\n\r\nThis adds the engine `decidim-comments` and will add the capability to add comments to any component using a simple Rails helper like this:\r\n\r\n```ruby\r\n<%= comments_for @proposal %>\r\n```\r\n\r\nThis is the first engine using frontend components with React. Since is an isolated engine it's using its own way to compile assets merging the Rails assets pipeline with Webpack.\r\n\r\nWe are gonna start simple: just one level of hierarchy without extra features like voting or arguing comments.\r\n\r\n#### :clipboard: Related documentation\r\n- https://github.com/airbnb/enzyme\r\n- https://github.com/producthunt/chai-enzyme\r\n\r\n#### :pushpin: Related Issues\r\n- Implements part of #160 \r\n- Replace #241\r\n\r\n#### :clipboard: Subtasks\r\n- [x] Basic static components\r\n- [x] Components test suite\r\n- [x] Make components dynamic using Apollo Client\r\n- [x] Create comments backend\r\n- [x] Add types to GraphQL schema\r\n- [x] Seeds\r\n- [x] Add comment form\r\n- [x] Add addComment command\r\n- [x] Add feature tests\r\n- [x] ~Pagination~ (out of scope for this pr)\r\n- [x] I18n\r\n- [x] ~Authentication~ (out of scope for this pr, fallback to cookies)\r\n- [x] What do with bundle.js\r\n- [x] Documentation\r\n\r\n### :camera: Screenshots (optional)\r\nNone\r\n\r\n#### :ghost: GIF\r\nNone","created_at":"2016-11-17T13:48:52Z","updated_at":"2016-12-07T15:02:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"884f777ac228a0027b301b4e6e70f8a8ac62595c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250/commits","review_comments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250/comments","review_comment_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/250/comments","statuses_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/statuses/077e132e633454c2d35ebcf095a5d7bcd130fcb8","head":{"label":"AjuntamentdeBarcelona:feature/comments-module","ref":"feature/comments-module","sha":"077e132e633454c2d35ebcf095a5d7bcd130fcb8","user":{"login":"AjuntamentdeBarcelona","id":16301934,"avatar_url":"https://avatars.githubusercontent.com/u/16301934?v=3","gravatar_id":"","url":"https://api.github.com/users/AjuntamentdeBarcelona","html_url":"https://github.com/AjuntamentdeBarcelona","followers_url":"https://api.github.com/users/AjuntamentdeBarcelona/followers","following_url":"https://api.github.com/users/AjuntamentdeBarcelona/following{/other_user}","gists_url":"https://api.github.com/users/AjuntamentdeBarcelona/gists{/gist_id}","starred_url":"https://api.github.com/users/AjuntamentdeBarcelona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AjuntamentdeBarcelona/subscriptions","organizations_url":"https://api.github.com/users/AjuntamentdeBarcelona/orgs","repos_url":"https://api.github.com/users/AjuntamentdeBarcelona/repos","events_url":"https://api.github.com/users/AjuntamentdeBarcelona/events{/privacy}","received_events_url":"https://api.github.com/users/AjuntamentdeBarcelona/received_events","type":"Organization","site_admin":false},"repo":{"id":65914086,"name":"decidim","full_name":"AjuntamentdeBarcelona/decidim","owner":{"login":"AjuntamentdeBarcelona","id":16301934,"avatar_url":"https://avatars.githubusercontent.com/u/16301934?v=3","gravatar_id":"","url":"https://api.github.com/users/AjuntamentdeBarcelona","html_url":"https://github.com/AjuntamentdeBarcelona","followers_url":"https://api.github.com/users/AjuntamentdeBarcelona/followers","following_url":"https://api.github.com/users/AjuntamentdeBarcelona/following{/other_user}","gists_url":"https://api.github.com/users/AjuntamentdeBarcelona/gists{/gist_id}","starred_url":"https://api.github.com/users/AjuntamentdeBarcelona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AjuntamentdeBarcelona/subscriptions","organizations_url":"https://api.github.com/users/AjuntamentdeBarcelona/orgs","repos_url":"https://api.github.com/users/AjuntamentdeBarcelona/repos","events_url":"https://api.github.com/users/AjuntamentdeBarcelona/events{/privacy}","received_events_url":"https://api.github.com/users/AjuntamentdeBarcelona/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AjuntamentdeBarcelona/decidim","description":"The participatory democracy framework","fork":false,"url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim","forks_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/forks","keys_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/teams","hooks_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/hooks","issue_events_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/events{/number}","events_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/events","assignees_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/assignees{/user}","branches_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/branches{/branch}","tags_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/tags","blobs_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/refs{/sha}","trees_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/statuses/{sha}","languages_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/languages","stargazers_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/stargazers","contributors_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/contributors","subscribers_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/subscribers","subscription_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/subscription","commits_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/commits{/sha}","git_commits_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/commits{/sha}","comments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/comments{/number}","issue_comment_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/comments{/number}","contents_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/contents/{+path}","compare_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/merges","archive_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/downloads","issues_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues{/number}","pulls_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls{/number}","milestones_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/milestones{/number}","notifications_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/labels{/name}","releases_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/releases{/id}","deployments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/deployments","created_at":"2016-08-17T14:27:06Z","updated_at":"2016-12-06T18:34:17Z","pushed_at":"2016-12-07T14:50:32Z","git_url":"git://github.com/AjuntamentdeBarcelona/decidim.git","ssh_url":"git@github.com:AjuntamentdeBarcelona/decidim.git","clone_url":"https://github.com/AjuntamentdeBarcelona/decidim.git","svn_url":"https://github.com/AjuntamentdeBarcelona/decidim","homepage":"","size":5108,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":39,"forks":4,"open_issues":39,"watchers":6,"default_branch":"master"}},"base":{"label":"AjuntamentdeBarcelona:master","ref":"master","sha":"26b56cbe11028a53a93aecba04d3dc0ef433d289","user":{"login":"AjuntamentdeBarcelona","id":16301934,"avatar_url":"https://avatars.githubusercontent.com/u/16301934?v=3","gravatar_id":"","url":"https://api.github.com/users/AjuntamentdeBarcelona","html_url":"https://github.com/AjuntamentdeBarcelona","followers_url":"https://api.github.com/users/AjuntamentdeBarcelona/followers","following_url":"https://api.github.com/users/AjuntamentdeBarcelona/following{/other_user}","gists_url":"https://api.github.com/users/AjuntamentdeBarcelona/gists{/gist_id}","starred_url":"https://api.github.com/users/AjuntamentdeBarcelona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AjuntamentdeBarcelona/subscriptions","organizations_url":"https://api.github.com/users/AjuntamentdeBarcelona/orgs","repos_url":"https://api.github.com/users/AjuntamentdeBarcelona/repos","events_url":"https://api.github.com/users/AjuntamentdeBarcelona/events{/privacy}","received_events_url":"https://api.github.com/users/AjuntamentdeBarcelona/received_events","type":"Organization","site_admin":false},"repo":{"id":65914086,"name":"decidim","full_name":"AjuntamentdeBarcelona/decidim","owner":{"login":"AjuntamentdeBarcelona","id":16301934,"avatar_url":"https://avatars.githubusercontent.com/u/16301934?v=3","gravatar_id":"","url":"https://api.github.com/users/AjuntamentdeBarcelona","html_url":"https://github.com/AjuntamentdeBarcelona","followers_url":"https://api.github.com/users/AjuntamentdeBarcelona/followers","following_url":"https://api.github.com/users/AjuntamentdeBarcelona/following{/other_user}","gists_url":"https://api.github.com/users/AjuntamentdeBarcelona/gists{/gist_id}","starred_url":"https://api.github.com/users/AjuntamentdeBarcelona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AjuntamentdeBarcelona/subscriptions","organizations_url":"https://api.github.com/users/AjuntamentdeBarcelona/orgs","repos_url":"https://api.github.com/users/AjuntamentdeBarcelona/repos","events_url":"https://api.github.com/users/AjuntamentdeBarcelona/events{/privacy}","received_events_url":"https://api.github.com/users/AjuntamentdeBarcelona/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AjuntamentdeBarcelona/decidim","description":"The participatory democracy framework","fork":false,"url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim","forks_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/forks","keys_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/teams","hooks_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/hooks","issue_events_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/events{/number}","events_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/events","assignees_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/assignees{/user}","branches_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/branches{/branch}","tags_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/tags","blobs_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/refs{/sha}","trees_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/statuses/{sha}","languages_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/languages","stargazers_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/stargazers","contributors_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/contributors","subscribers_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/subscribers","subscription_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/subscription","commits_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/commits{/sha}","git_commits_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/git/commits{/sha}","comments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/comments{/number}","issue_comment_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/comments{/number}","contents_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/contents/{+path}","compare_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/merges","archive_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/downloads","issues_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues{/number}","pulls_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls{/number}","milestones_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/milestones{/number}","notifications_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/labels{/name}","releases_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/releases{/id}","deployments_url":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/deployments","created_at":"2016-08-17T14:27:06Z","updated_at":"2016-12-06T18:34:17Z","pushed_at":"2016-12-07T14:50:32Z","git_url":"git://github.com/AjuntamentdeBarcelona/decidim.git","ssh_url":"git@github.com:AjuntamentdeBarcelona/decidim.git","clone_url":"https://github.com/AjuntamentdeBarcelona/decidim.git","svn_url":"https://github.com/AjuntamentdeBarcelona/decidim","homepage":"","size":5108,"stargazers_count":6,"watchers_count":6,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":39,"forks":4,"open_issues":39,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250"},"html":{"href":"https://github.com/AjuntamentdeBarcelona/decidim/pull/250"},"issue":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/250"},"comments":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/issues/250/comments"},"review_comments":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250/comments"},"review_comment":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/pulls/250/commits"},"statuses":{"href":"https://api.github.com/repos/AjuntamentdeBarcelona/decidim/statuses/077e132e633454c2d35ebcf095a5d7bcd130fcb8"}}}}
{"actor":{"display_login":"beagleknight"}}