Sha256: fb4a878ba17f62d58a90a4632a284a6a0a4a443b09e65cdf1af9df43913e57a4

Contents?: true

Size: 1.19 KB

Versions: 16

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

module Decidim
  module Core
    # This type represents a UserGroup
    UserGroupType = GraphQL::ObjectType.define do
      name "UserGroup"
      description "A user group"

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

      field :id, !types.ID, "The user group's id"

      field :name, !types.String, "The user group's name"

      field :nickname, !types.String, "User groups have no nickname" do
        resolve ->(obj, _args, _ctx) { UserGroupPresenter.new(obj).nickname }
      end

      field :avatarUrl, !types.String, "The user's avatar url" do
        resolve ->(obj, _args, _ctx) { UserGroupPresenter.new(obj).avatar_url }
      end

      field :profilePath, !types.String, "The user's profile url" do
        resolve ->(obj, _args, _ctx) { UserGroupPresenter.new(obj).profile_path }
      end

      field :deleted, !types.Boolean, "Whether the user group's has been deleted or not" do
        resolve ->(obj, _args, _ctx) { UserGroupPresenter.new(obj).deleted? }
      end

      field :badge, !types.String, "A badge for the user group" do
        resolve ->(obj, _args, _ctx) { UserGroupPresenter.new(obj).badge }
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-core-0.14.4 app/types/decidim/core/user_group_type.rb
decidim-core-0.14.3 app/types/decidim/core/user_group_type.rb
decidim-core-0.14.2 app/types/decidim/core/user_group_type.rb
decidim-core-0.14.1 app/types/decidim/core/user_group_type.rb
decidim-core-0.13.1 app/types/decidim/core/user_group_type.rb
decidim-core-0.12.2 app/types/decidim/core/user_group_type.rb
decidim-core-0.13.0 app/types/decidim/core/user_group_type.rb
decidim-core-0.12.1 app/types/decidim/core/user_group_type.rb
decidim-core-0.13.0.pre1 app/types/decidim/core/user_group_type.rb
decidim-core-0.12.0 app/types/decidim/core/user_group_type.rb
decidim-core-0.11.2 app/types/decidim/core/user_group_type.rb
decidim-core-0.12.0.pre app/types/decidim/core/user_group_type.rb
decidim-core-0.11.1 app/types/decidim/core/user_group_type.rb
decidim-core-0.11.0.pre1 app/types/decidim/core/user_group_type.rb
decidim-core-0.10.1 app/types/decidim/core/user_group_type.rb
decidim-core-0.10.0 app/types/decidim/core/user_group_type.rb