Ability to access proposals, debates and comments authored by a specific user

This commit is contained in:
Alberto Miedes Garcés
2016-10-12 17:57:56 +02:00
parent c96d1c460a
commit 757e68969d

View File

@@ -1,7 +1,9 @@
UserType = GraphQL::ObjectType.define do
name "User"
description "An user entry, returns basic user information"
# Expose fields associated with User model
field :id, !types.ID, "The id of this user"
field :created_at, types.String, "Date when this user was created"
field :username, types.String, "The username of this user"
@@ -10,5 +12,18 @@ UserType = GraphQL::ObjectType.define do
field :date_of_birth, types.String, "The birthdate of this user"
# Linked resources
field :geozone, GeozoneType, "Geozone where this user is registered"
connection :proposals, ProposalType.connection_type do
description "Proposals authored by this user"
end
connection :debates, DebateType.connection_type do
description "Debates authored by this user"
end
connection :comments, CommentType.connection_type do
description "Comments authored by this user"
end
end