Commit e1b8152b authored by lauraMon's avatar lauraMon

Adds fields to UserType, PipelineType and a new type

* Adds triggering user to PipelineType
* Adds email and status to UserType
* Adds UserStatusType with message_html field
* Updates user spec to add email and status field
parent 83e64811
......@@ -45,8 +45,8 @@ module Types
description: 'Stages of the pipeline',
extras: [:lookahead],
resolver: Resolvers::Ci::PipelineStagesResolver
# TODO: Add triggering user as a type
field :user, Types::UserType, null: true,
description: 'Pipeline user'
end
end
end
......
# frozen_string_literal: true
module Types
class UserStatusType < BaseObject
graphql_name 'UserStatus'
expose_permissions Types::PermissionTypes::User
field :message_html, GraphQL::STRING_TYPE, null: true,
description: 'HTML of the user status message'
end
end
......@@ -18,6 +18,8 @@ module Types
description: 'Human-readable name of the user'
field :state, Types::UserStateEnum, null: false,
description: 'State of the user'
field :email, GraphQL::STRING_TYPE, null:true,
description: 'User email'
field :avatar_url, GraphQL::STRING_TYPE, null: true,
description: "URL of the user's avatar"
field :web_url, GraphQL::STRING_TYPE, null: false,
......@@ -30,6 +32,8 @@ module Types
field :group_memberships, Types::GroupMemberType.connection_type, null: true,
description: 'Group memberships of the user',
method: :group_members
field :status, Types::UserStatusType, null:true,
description: 'User status'
field :project_memberships, Types::ProjectMemberType.connection_type, null: true,
description: 'Project memberships of the user',
method: :project_members
......
......@@ -14,11 +14,13 @@ RSpec.describe GitlabSchema.types['User'] do
snippets
name
username
email
avatarUrl
webUrl
webPath
todos
state
status
authoredMergeRequests
assignedMergeRequests
groupMemberships
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment