Commit 158a8c80 authored by lauraMon's avatar lauraMon

Updates GraphQL schema and docs

* Also fixes some strange linting
* Adds some fields to User spec
* Disabled RuboCop authorization type for UserStatus
parent a9d21c95
# frozen_string_literal: true
module Types
# rubocop: disable Graphql/AuthorizeTypes
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'
......
......@@ -18,7 +18,7 @@ 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,
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"
......@@ -32,7 +32,7 @@ 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,
field :status, Types::UserStatusType, null: true,
description: 'User status'
field :project_memberships, Types::ProjectMemberType.connection_type, null: true,
description: 'Project memberships of the user',
......
......@@ -10422,6 +10422,11 @@ type Pipeline {
"""
updatedAt: Time!
"""
Pipeline user
"""
user: User
"""
Permissions for the current user on the resource
"""
......@@ -16462,6 +16467,11 @@ type User {
"""
avatarUrl: String
"""
User email
"""
email: String
"""
Group memberships of the user
"""
......@@ -16567,6 +16577,11 @@ type User {
"""
state: UserState!
"""
User status
"""
status: UserStatus
"""
Todos of the user
"""
......@@ -16705,6 +16720,13 @@ enum UserState {
deactivated
}
type UserStatus {
"""
HTML of the user status message
"""
messageHtml: String
}
enum VisibilityLevelsEnum {
internal
private
......
......@@ -31145,6 +31145,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "user",
"description": "Pipeline user",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "userPermissions",
"description": "Permissions for the current user on the resource",
......@@ -48275,6 +48289,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "email",
"description": "User email",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "groupMemberships",
"description": "Group memberships of the user",
......@@ -48526,6 +48554,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "status",
"description": "User status",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "UserStatus",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "todos",
"description": "Todos of the user",
......@@ -48943,6 +48985,33 @@
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "UserStatus",
"description": null,
"fields": [
{
"name": "messageHtml",
"description": "HTML of the user status message",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [
],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "VisibilityLevelsEnum",
......@@ -1604,6 +1604,7 @@ Information about pagination in a connection.
| `startedAt` | Time | Timestamp when the pipeline was started |
| `status` | PipelineStatusEnum! | Status of the pipeline (CREATED, WAITING_FOR_RESOURCE, PREPARING, PENDING, RUNNING, FAILED, SUCCESS, CANCELED, SKIPPED, MANUAL, SCHEDULED) |
| `updatedAt` | Time! | Timestamp of the pipeline's last activity |
| `user` | User | Pipeline user |
| `userPermissions` | PipelinePermissions! | Permissions for the current user on the resource |
## PipelinePermissions
......@@ -2434,9 +2435,11 @@ Autogenerated return type of UpdateSnippet
| Name | Type | Description |
| --- | ---- | ---------- |
| `avatarUrl` | String | URL of the user's avatar |
| `email` | String | User email |
| `id` | ID! | ID of the user |
| `name` | String! | Human-readable name of the user |
| `state` | UserState! | State of the user |
| `status` | UserStatus | User status |
| `userPermissions` | UserPermissions! | Permissions for the current user on the resource |
| `username` | String! | Username of the user. Unique within this instance of GitLab |
| `webPath` | String! | Web path of the user |
......@@ -2448,6 +2451,12 @@ Autogenerated return type of UpdateSnippet
| --- | ---- | ---------- |
| `createSnippet` | Boolean! | Indicates the user can perform `create_snippet` on this resource |
## UserStatus
| Name | Type | Description |
| --- | ---- | ---------- |
| `messageHtml` | String | HTML of the user status message |
## VulnerabilitiesCountByDay
Represents the count of vulnerabilities by severity on a particular day
......
......@@ -75,7 +75,9 @@ RSpec.describe 'getting user information' do
'name' => presenter.name,
'username' => presenter.username,
'webUrl' => presenter.web_url,
'avatarUrl' => presenter.avatar_url
'avatarUrl' => presenter.avatar_url,
'status' => presenter.status,
'email' => presenter.email
))
end
......
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