Sha256: c350f88a991e02110b49c9b2768fd3850cc7bd9b24ac3a665d15fec903dd38e3

Contents?: true

Size: 695 Bytes

Versions: 28

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    # This interface represents a commentable object.
    AuthorableInterface = GraphQL::InterfaceType.define do
      name "AuthorableInterface"
      description "An interface that can be used in authorable objects."

      field :author, Decidim::Core::AuthorInterface, "The resource author" do
        # can be an Authorable or a Coauthorable
        resolve ->(authorable, _, _) {
          if authorable.respond_to?(:normalized_author)
            authorable&.normalized_author
          elsif authorable.respond_to?(:creator_identity)
            authorable&.creator_identity
          end
        }
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
decidim-core-0.23.6 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.5 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.4 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.3 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.2 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.1.rc1 lib/decidim/api/authorable_interface.rb
decidim-core-0.23.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.22.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.21.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.20.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.20.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.19.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.18.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.19.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.17.2 lib/decidim/api/authorable_interface.rb
decidim-core-0.18.0 lib/decidim/api/authorable_interface.rb
decidim-core-0.17.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.16.1 lib/decidim/api/authorable_interface.rb
decidim-core-0.17.0 lib/decidim/api/authorable_interface.rb