Deleted old GraphQL type files
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
CommentType = GraphQL::ObjectType.define do
|
|
||||||
name "Comment"
|
|
||||||
description "A reply to a proposal, spending proposal, debate or comment"
|
|
||||||
|
|
||||||
field :id, !types.ID, "The unique ID of this comment"
|
|
||||||
field :commentable_id, types.Int, "ID of the resource where this comment was placed on"
|
|
||||||
field :commentable_type, types.String, "Type of resource where this comment was placed on"
|
|
||||||
field :body, types.String, "The body of this comment"
|
|
||||||
field :subject, types.String, "The subject of this comment"
|
|
||||||
field :user_id, !types.Int, "The ID of the user who made this comment"
|
|
||||||
field :created_at, types.String, "The date this comment was posted"
|
|
||||||
field :updated_at, types.String, "The date this comment was edited"
|
|
||||||
field :flags_count, types.Int, "The number of flags of this comment"
|
|
||||||
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"
|
|
||||||
field :commentable, CommentableInterface, "Element which was commented"
|
|
||||||
end
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
CommentableInterface = GraphQL::InterfaceType.define do
|
|
||||||
name "Commentable"
|
|
||||||
|
|
||||||
# Expose fields associated with Commentable models
|
|
||||||
|
|
||||||
field :id, !types.ID, "ID of the commentable"
|
|
||||||
field :title, types.String, "The title of this commentable"
|
|
||||||
field :description, types.String, "The description of this commentable"
|
|
||||||
field :author_id, types.Int, "ID of the author of this commentable"
|
|
||||||
field :comments_count, types.Int, "Number of comments on this commentable"
|
|
||||||
|
|
||||||
# Linked resources
|
|
||||||
|
|
||||||
field :author, UserType, "Author of this commentable"
|
|
||||||
|
|
||||||
connection :comments, CommentType.connection_type do
|
|
||||||
description "Comments in this commentable"
|
|
||||||
end
|
|
||||||
|
|
||||||
field :geozone, GeozoneType, "Geozone affected by this commentable"
|
|
||||||
end
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
DebateType = GraphQL::ObjectType.define do
|
|
||||||
name "Debate"
|
|
||||||
description "A single debate entry with associated info"
|
|
||||||
|
|
||||||
interfaces([CommentableInterface])
|
|
||||||
|
|
||||||
# Expose fields associated with Debate model
|
|
||||||
|
|
||||||
field :id, !types.ID, "The id of this debate"
|
|
||||||
field :title, types.String, "The title of this debate"
|
|
||||||
field :description, types.String, "The description of this debate"
|
|
||||||
field :author_id, types.Int, "ID of the author of this proposal"
|
|
||||||
field :created_at, types.String, "Date when this debate was created"
|
|
||||||
field :updated_at, types.String, "Date when this debate was edited"
|
|
||||||
field :flags_count, types.Int, "Number of flags of this debate"
|
|
||||||
field :cached_votes_total, types.Int, "The total number of votes of this debate"
|
|
||||||
field :cached_votes_up, types.Int, "The total number of upvotes of this debate"
|
|
||||||
field :cached_votes_down, types.Int, "The total number of downvotes of this debate"
|
|
||||||
field :comments_count, types.Int, "Number of comments on this debate"
|
|
||||||
field :geozone_id, types.Int, "ID of the geozone affected by this debate"
|
|
||||||
|
|
||||||
# Linked resources
|
|
||||||
|
|
||||||
field :author, UserType, "Author of this debate"
|
|
||||||
|
|
||||||
connection :comments, CommentType.connection_type do
|
|
||||||
description "Comments in this debate"
|
|
||||||
end
|
|
||||||
|
|
||||||
field :geozone, GeozoneType, "Geozone affected by this debate"
|
|
||||||
end
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
GeozoneType = GraphQL::ObjectType.define do
|
|
||||||
name "Geozone"
|
|
||||||
description "A geozone entry, returns basic geozone information"
|
|
||||||
# Expose fields associated with Geozone model
|
|
||||||
field :id, !types.ID, "The id of this geozone"
|
|
||||||
field :name, types.String, "The name of this geozone"
|
|
||||||
field :html_map_coordinates, types.String, "HTML map coordinates of this geozone"
|
|
||||||
field :external_code, types.String, "The external code of this geozone"
|
|
||||||
field :census_code, types.String, "The census code of this geozone"
|
|
||||||
end
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
ProposalType = GraphQL::ObjectType.define do
|
|
||||||
name "Proposal"
|
|
||||||
description "A single proposal entry returns a proposal with author, total votes and comments"
|
|
||||||
|
|
||||||
interfaces([CommentableInterface])
|
|
||||||
|
|
||||||
# Expose fields associated with Proposal model
|
|
||||||
|
|
||||||
field :id, !types.ID, "The id of this proposal"
|
|
||||||
field :title, types.String, "The title of this proposal"
|
|
||||||
field :description, types.String, "The description of this proposal"
|
|
||||||
field :question, types.String, "The question of this proposal"
|
|
||||||
field :external_url, types.String, "External url related to this proposal"
|
|
||||||
field :author_id, types.Int, "ID of the author of this proposal"
|
|
||||||
field :flags_count, types.Int, "Number of flags of this proposal"
|
|
||||||
field :cached_votes_up, types.Int, "Number of upvotes of this proposal"
|
|
||||||
field :comments_count, types.Int, "Number of comments on this proposal"
|
|
||||||
field :summary, types.String, "The summary of this proposal"
|
|
||||||
field :video_url, types.String, "External video url related to this proposal"
|
|
||||||
field :geozone_id, types.Int, "ID of the geozone affected by this proposal"
|
|
||||||
field :retired_at, types.String, "Date when this proposal was retired"
|
|
||||||
field :retired_reason, types.String, "Reason why this proposal was retired"
|
|
||||||
field :retired_explanation, types.String, "Explanation why this proposal was retired"
|
|
||||||
|
|
||||||
# Linked resources
|
|
||||||
|
|
||||||
field :author, UserType, "Author of this proposal"
|
|
||||||
|
|
||||||
connection :comments, CommentType.connection_type do
|
|
||||||
description "Comments in this proposal"
|
|
||||||
end
|
|
||||||
|
|
||||||
field :geozone, GeozoneType, "Geozone affected by this proposal"
|
|
||||||
end
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
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"
|
|
||||||
field :geozone_id, types.Int, "The ID of the geozone where this user is active"
|
|
||||||
field :gender, types.String, "The gender of this user"
|
|
||||||
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