debian-mirror-gitlab/app/graphql/types/user_type.rb

24 lines
778 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Types
class UserType < BaseObject
graphql_name 'User'
2019-07-07 11:18:12 +05:30
authorize :read_user
2019-02-15 15:39:39 +05:30
present_using UserPresenter
2019-12-26 22:10:19 +05:30
field :name, GraphQL::STRING_TYPE, null: false,
description: 'Human-readable name of the user'
field :username, GraphQL::STRING_TYPE, null: false,
description: 'Username of the user. Unique within this instance of GitLab'
field :avatar_url, GraphQL::STRING_TYPE, null: false,
description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false,
description: 'Web URL of the user'
2019-12-21 20:55:43 +05:30
field :todos, Types::TodoType.connection_type, null: false,
resolver: Resolvers::TodoResolver,
2019-12-26 22:10:19 +05:30
description: 'Todos of the user'
2019-02-15 15:39:39 +05:30
end
end