Sha256: 99b27e53bad72aa48347e3735b2cec3cf44d64503a329d04b0c7acd88f3fd00b

Contents?: true

Size: 922 Bytes

Versions: 40

Compression:

Stored size: 922 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This type represents a User.
  UserType = GraphQL::ObjectType.define do
    name "User"
    description "A user"

    interfaces [
      Decidim::AuthorInterface
    ]

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

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

    field :organizationName, !types.String, "The user's organization name" do
      resolve ->(obj, _args, _ctx) { obj.organization.name }
    end

    field :isVerified, !types.Boolean, "Whether the author is verified or not" do
      resolve ->(_obj, _args, _ctx) { false }
    end

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

    field :isUser, !types.Boolean, "User groups are not users" do
      resolve ->(_obj, _args, _ctx) { true }
    end
  end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
decidim-core-0.8.4 lib/decidim/core/api/user_type.rb
decidim-core-0.8.3 lib/decidim/core/api/user_type.rb
decidim-core-0.8.2 lib/decidim/core/api/user_type.rb
decidim-core-0.8.1 lib/decidim/core/api/user_type.rb
decidim-core-0.8.0 lib/decidim/core/api/user_type.rb
decidim-core-0.7.4 lib/decidim/core/api/user_type.rb
decidim-core-0.7.3 lib/decidim/core/api/user_type.rb
decidim-core-0.7.2 lib/decidim/core/api/user_type.rb
decidim-core-0.7.1 lib/decidim/core/api/user_type.rb
decidim-core-0.7.0 lib/decidim/core/api/user_type.rb
decidim-core-0.6.8 lib/decidim/core/api/user_type.rb
decidim-0.6.8 decidim-core/lib/decidim/core/api/user_type.rb
decidim-core-0.6.7 lib/decidim/core/api/user_type.rb
decidim-0.6.7 decidim-core/lib/decidim/core/api/user_type.rb
decidim-core-0.6.6 lib/decidim/core/api/user_type.rb
decidim-0.6.6 decidim-core/lib/decidim/core/api/user_type.rb
decidim-core-0.6.5 lib/decidim/core/api/user_type.rb
decidim-0.6.5 decidim-core/lib/decidim/core/api/user_type.rb
decidim-core-0.6.4 lib/decidim/core/api/user_type.rb
decidim-0.6.4 decidim-core/lib/decidim/core/api/user_type.rb