From 657f57f9a2161b0baef6be78474e99e49d73173e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Thu, 29 Sep 2016 13:26:54 +0200 Subject: [PATCH] Ability to link authors/users from comments and proposals --- app/graph/types/comment_type.rb | 3 +++ app/graph/types/proposal_type.rb | 1 + 2 files changed, 4 insertions(+) diff --git a/app/graph/types/comment_type.rb b/app/graph/types/comment_type.rb index 8701ee04f..9078257af 100644 --- a/app/graph/types/comment_type.rb +++ b/app/graph/types/comment_type.rb @@ -14,4 +14,7 @@ CommentType = GraphQL::ObjectType.define do field :cached_votes_total, types.Int, "The total number of votes of this comment" field :cached_votes_up, types.Int, "The total number of upvotes of this comment" field :cached_votes_down, types.Int, "The total number of downvotes of this comment" + + # Linked resources + field :user, !UserType, "User who made this comment" end diff --git a/app/graph/types/proposal_type.rb b/app/graph/types/proposal_type.rb index 2bc1e37b0..1e3514997 100644 --- a/app/graph/types/proposal_type.rb +++ b/app/graph/types/proposal_type.rb @@ -19,5 +19,6 @@ ProposalType = GraphQL::ObjectType.define do field :retired_explanation, types.String, "Explanation why this proposal was retired" # Linked resources + field :author, UserType, "Author of this proposal" field :comments, !types[!CommentType], "Comments in this proposal" end