Sha256: 8b831f88faa39324a232f1197a86dbd3ebdf42b5bf3edee19ce736e403edacb4

Contents?: true

Size: 1.02 KB

Versions: 10

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    QuestionType = GraphQL::ObjectType.define do
      name "Question"
      description "A question in a questionnaire"

      interfaces [
        -> { Decidim::Core::TimestampsInterface }
      ]

      field :id, !types.ID, "ID of this question"
      field :body, !Decidim::Core::TranslatedFieldType, "What is being asked in this question."
      field :description, Decidim::Core::TranslatedFieldType, "The description of this question."
      field :mandatory, !types.Boolean, "Whether if this question is mandatory."
      field :position, types.Int, "Order position of the question in the questionnaire"
      field :maxChoices, types.Int, "On questions with answer options, maximum number of choices the user has", property: :max_choices
      field :questionType, types.String, "Type of question.", property: :question_type
      field :answerOptions, !types[AnswerOptionType], "List of answer options in multi-choice questions.", property: :answer_options
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-forms-0.23.6 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.5 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.4 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.3 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.2 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.1 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.1.rc1 app/types/decidim/forms/question_type.rb
decidim-forms-0.23.0 app/types/decidim/forms/question_type.rb
decidim-forms-0.22.0 app/types/decidim/forms/question_type.rb
decidim-forms-0.21.0 app/types/decidim/forms/question_type.rb