Sha256: 38f8ae514a43d81227d91d01c898f6eab2caa7a17fa29674fbdee792a977e59c

Contents?: true

Size: 553 Bytes

Versions: 4

Compression:

Stored size: 553 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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-core-0.1.0 lib/decidim/core/api/user_type.rb
decidim-core-0.0.8.1 lib/decidim/core/api/user_type.rb
decidim-core-0.0.7 lib/decidim/core/api/user_type.rb
decidim-core-0.0.6 lib/decidim/core/api/user_type.rb