Sha256: 20df720599f58ae0a9f313a58c0673c5769c40f269afea1efaaa2dca0450dae2

Contents?: true

Size: 566 Bytes

Versions: 10

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    # This interface should be implemented by any Type that can be used as amendment
    # The only requirement is to have an ID and the Type name be the class.name + Type
    AmendableEntityInterface = GraphQL::InterfaceType.define do
      name "AmendableEntityInterface"
      description "An interface that can be used in objects with amendments"

      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-core-0.23.6 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.5 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.4 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.3 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.2 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.1 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.1.rc1 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.23.0 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.22.0 lib/decidim/api/amendable_entity_interface.rb
decidim-core-0.21.0 lib/decidim/api/amendable_entity_interface.rb