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
|
UserType = GraphQL::ObjectType.define do
|
||||||
name "User"
|
name "User"
|
||||||
description "An user entry, returns basic user information"
|
description "An user entry, returns basic user information"
|
||||||
|
|
||||||
# Expose fields associated with User model
|
# Expose fields associated with User model
|
||||||
|
|
||||||
field :id, !types.ID, "The id of this user"
|
field :id, !types.ID, "The id of this user"
|
||||||
field :created_at, types.String, "Date when this user was created"
|
field :created_at, types.String, "Date when this user was created"
|
||||||
field :username, types.String, "The username of this user"
|
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"
|
field :date_of_birth, types.String, "The birthdate of this user"
|
||||||
|
|
||||||
# Linked resources
|
# Linked resources
|
||||||
|
|
||||||
field :geozone, GeozoneType, "Geozone where this user is registered"
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user