Sha256: b97deb81bfc9379cd4b7c7486b9b2fd30ed39ad146ceb5692641ba41f013ebb3

Contents?: true

Size: 878 Bytes

Versions: 31

Compression:

Stored size: 878 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Core
    # This interface represents an author who owns a resource.
    AuthorInterface = GraphQL::InterfaceType.define do
      name "Author"
      description "An author"

      field :name, !types.String, "The author's name"
      field :nickname, !types.String, "The author's nickname"

      field :avatarUrl, !types.String, "The author's avatar url"
      field :profilePath, !types.String, "The author's profile path"
      field :badge, !types.String, "The author's badge icon"

      field :deleted, !types.Boolean, "Whether the author's account has been deleted or not"

      resolve_type ->(obj, _ctx) {
                     return Decidim::Core::UserType if obj.is_a? Decidim::User
                     return Decidim::Core::UserGroupType if obj.is_a? Decidim::UserGroup
                   }
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-core-0.21.0 lib/decidim/api/author_interface.rb
decidim-core-0.20.1 lib/decidim/api/author_interface.rb
decidim-core-0.20.0 lib/decidim/api/author_interface.rb
decidim-core-0.19.1 lib/decidim/api/author_interface.rb
decidim-core-0.18.1 lib/decidim/api/author_interface.rb
decidim-core-0.19.0 lib/decidim/api/author_interface.rb
decidim-core-0.17.2 lib/decidim/api/author_interface.rb
decidim-core-0.18.0 lib/decidim/api/author_interface.rb
decidim-core-0.17.1 lib/decidim/api/author_interface.rb
decidim-core-0.16.1 lib/decidim/api/author_interface.rb
decidim-core-0.17.0 lib/decidim/api/author_interface.rb
decidim-core-0.16.0 lib/decidim/api/author_interface.rb
decidim-core-0.15.2 lib/decidim/api/author_interface.rb
decidim-core-0.15.1 lib/decidim/api/author_interface.rb
decidim-core-0.15.0 lib/decidim/api/author_interface.rb
decidim-core-0.14.4 lib/decidim/api/author_interface.rb
decidim-core-0.14.3 lib/decidim/api/author_interface.rb
decidim-core-0.14.2 lib/decidim/api/author_interface.rb
decidim-core-0.14.1 lib/decidim/api/author_interface.rb
decidim-core-0.13.1 lib/decidim/api/author_interface.rb