Sha256: e6c57b744f39271e8a69e805c46376fd05bcf155afcb2adb2e7cf6b1d2ee638e

Contents?: true

Size: 587 Bytes

Versions: 10

Compression:

Stored size: 587 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    # This interface should be implemented by any Type that can be linked to a questionnaire
    # The only requirement is to have an ID and the Type name be the class.name + Type
    QuestionnaireEntityInterface = GraphQL::InterfaceType.define do
      name "QuestionnaireEntityInterface"
      description "An interface that can be used in objects with questionnaires"

      field :id, !types.ID, "ID of this entity"

      resolve_type ->(obj, _ctx) {
        "#{obj.class.name}Type".constantize
      }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-forms-0.23.6 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.5 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.4 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.3 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.2 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.1 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.1.rc1 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.23.0 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.22.0 lib/decidim/api/questionnaire_entity_interface.rb
decidim-forms-0.21.0 lib/decidim/api/questionnaire_entity_interface.rb