Sha256: 1f0b6c5ffd945e6d1202dcb482c9451bd8e5ff72577c2bc42ba37ad59c29ab2b
Contents?: true
Size: 1.33 KB
Versions: 38
Compression:
Stored size: 1.33 KB
Contents
# frozen_string_literal: true module Decidim module Elections # This type represents an answer to an election question. # The name is different from the model because to enforce consistency with Question type name. class ElectionAnswerType < Decidim::Api::Types::BaseObject implements Decidim::Core::AttachableInterface implements Decidim::Core::TraceableInterface description "An answer for an election's question" field :id, GraphQL::Types::ID, "The internal ID of this answer", null: false field :title, Decidim::Core::TranslatedFieldType, "The title for this answer", null: false field :description, Decidim::Core::TranslatedFieldType, "The description for this answer", null: true field :weight, GraphQL::Types::Int, "The ordering weight for this answer", null: true field :results_total, GraphQL::Types::Int, "The total sum of votes for this answer", null: true, camelize: false field :selected, GraphQL::Types::Boolean, "Is this answer selected?", null: true field :proposals, [Decidim::Proposals::ProposalType, { null: true }], "The proposals related to this answer", null: true if defined?(Decidim::Proposals::ProposalType) field :results, [Decidim::Elections::ElectionResultType, { null: true }], "The voting results related to this answer", null: true end end end
Version data entries
38 entries across 38 versions & 1 rubygems