Ability to link authors/users from comments and proposals

This commit is contained in:
Alberto Miedes Garcés
2016-09-29 13:26:54 +02:00
parent a6149018d9
commit 657f57f9a2
2 changed files with 4 additions and 0 deletions

View File

@@ -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

View File

@@ -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