From afb2d19ab32051a5888d055d525edea347cf757c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Miedes=20Garc=C3=A9s?= Date: Fri, 30 Sep 2016 11:49:34 +0200 Subject: [PATCH] Revised which fields are allowed to be null --- app/graph/types/geozone_type.rb | 2 +- app/graph/types/proposal_type.rb | 2 +- app/graph/types/query_root.rb | 4 ++-- app/graph/types/user_type.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/graph/types/geozone_type.rb b/app/graph/types/geozone_type.rb index fc4bb2343..bcea6dc93 100644 --- a/app/graph/types/geozone_type.rb +++ b/app/graph/types/geozone_type.rb @@ -2,7 +2,7 @@ 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 :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" diff --git a/app/graph/types/proposal_type.rb b/app/graph/types/proposal_type.rb index 58ece72a6..8456f0a4f 100644 --- a/app/graph/types/proposal_type.rb +++ b/app/graph/types/proposal_type.rb @@ -2,7 +2,7 @@ ProposalType = GraphQL::ObjectType.define do name "Proposal" description "A single proposal entry returns a proposal with author, total votes and comments" # Expose fields associated with Proposal model - field :id, types.ID, "The id of this proposal" + 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" diff --git a/app/graph/types/query_root.rb b/app/graph/types/query_root.rb index 5b8664dc6..1193f8b52 100644 --- a/app/graph/types/query_root.rb +++ b/app/graph/types/query_root.rb @@ -12,7 +12,7 @@ QueryRoot = GraphQL::ObjectType.define do end field :proposals do - type types[ProposalType] + type !types[!ProposalType] description "Find all Proposals" resolve -> (object, arguments, context) { Proposal.all @@ -29,7 +29,7 @@ QueryRoot = GraphQL::ObjectType.define do end field :comments do - type types[CommentType] + type !types[!CommentType] description "Find all Comments" resolve -> (object, arguments, context) { Comment.all diff --git a/app/graph/types/user_type.rb b/app/graph/types/user_type.rb index 224ae2702..bb64b818f 100644 --- a/app/graph/types/user_type.rb +++ b/app/graph/types/user_type.rb @@ -2,7 +2,7 @@ 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 :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"