Ability to access proposals, debates and comments authored by a specific user
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user