From e7de5c3a7f0c6e7bcc7b4caea1ada23e2bef02cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Tue, 8 Nov 2016 16:38:51 +0100 Subject: [PATCH] Deleted old GraphQL type files --- app/graph/types/comment_type.rb | 21 --------------- app/graph/types/commentable_interface.rb | 21 --------------- app/graph/types/debate_type.rb | 31 --------------------- app/graph/types/geozone_type.rb | 10 ------- app/graph/types/proposal_type.rb | 34 ------------------------ app/graph/types/user_type.rb | 29 -------------------- 6 files changed, 146 deletions(-) delete mode 100644 app/graph/types/comment_type.rb delete mode 100644 app/graph/types/commentable_interface.rb delete mode 100644 app/graph/types/debate_type.rb delete mode 100644 app/graph/types/geozone_type.rb delete mode 100644 app/graph/types/proposal_type.rb delete mode 100644 app/graph/types/user_type.rb diff --git a/app/graph/types/comment_type.rb b/app/graph/types/comment_type.rb deleted file mode 100644 index 36a9f709e..000000000 --- a/app/graph/types/comment_type.rb +++ /dev/null @@ -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 diff --git a/app/graph/types/commentable_interface.rb b/app/graph/types/commentable_interface.rb deleted file mode 100644 index ad51a55eb..000000000 --- a/app/graph/types/commentable_interface.rb +++ /dev/null @@ -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 diff --git a/app/graph/types/debate_type.rb b/app/graph/types/debate_type.rb deleted file mode 100644 index 1c36f8b40..000000000 --- a/app/graph/types/debate_type.rb +++ /dev/null @@ -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 diff --git a/app/graph/types/geozone_type.rb b/app/graph/types/geozone_type.rb deleted file mode 100644 index bcea6dc93..000000000 --- a/app/graph/types/geozone_type.rb +++ /dev/null @@ -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 diff --git a/app/graph/types/proposal_type.rb b/app/graph/types/proposal_type.rb deleted file mode 100644 index c9d599b8d..000000000 --- a/app/graph/types/proposal_type.rb +++ /dev/null @@ -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 diff --git a/app/graph/types/user_type.rb b/app/graph/types/user_type.rb deleted file mode 100644 index 922f51258..000000000 --- a/app/graph/types/user_type.rb +++ /dev/null @@ -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