Commit f14d22b6 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '228740-add-dismissed-by-field-to-graphql' into 'master'

Add dismissedBy field to vulnerability object in GraphQL

See merge request gitlab-org/gitlab!50285
parents 209ad1e0 5a73a464
......@@ -25731,6 +25731,11 @@ type Vulnerability implements Noteable {
"""
dismissedAt: Time
"""
The user that dismissed the vulnerability.
"""
dismissedBy: User
"""
List of external issue links related to the vulnerability
"""
......
......@@ -74671,6 +74671,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "dismissedBy",
"description": "The user that dismissed the vulnerability.",
"args": [
],
"type": {
"kind": "OBJECT",
"name": "User",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "externalIssueLinks",
"description": "List of external issue links related to the vulnerability",
......@@ -3817,6 +3817,7 @@ Represents a vulnerability.
| `detectedAt` | Time! | Timestamp of when the vulnerability was first detected |
| `discussions` | DiscussionConnection! | All discussions on this noteable |
| `dismissedAt` | Time | Timestamp of when the vulnerability state was changed to dismissed |
| `dismissedBy` | User | The user that dismissed the vulnerability. |
| `externalIssueLinks` | VulnerabilityExternalIssueLinkConnection! | List of external issue links related to the vulnerability |
| `hasSolutions` | Boolean | Indicates whether there is a solution available for this vulnerability. |
| `id` | ID! | GraphQL ID of the vulnerability |
......
......@@ -87,6 +87,9 @@ module Types
field :resolved_by, ::Types::UserType, null: true,
description: 'The user that resolved the vulnerability.'
field :dismissed_by, ::Types::UserType, null: true,
description: 'The user that dismissed the vulnerability.'
def confirmed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.confirmed_by_id).find
end
......@@ -95,6 +98,10 @@ module Types
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.resolved_by_id).find
end
def dismissed_by
::Gitlab::Graphql::Loaders::BatchModelLoader.new(::User, object.dismissed_by_id).find
end
def user_notes_count
::Gitlab::Graphql::Aggregations::Vulnerabilities::LazyUserNotesCountAggregate.new(context, object)
end
......
---
title: Add dismissedBy field to vulnerability object in GraphQL
merge_request: 50285
author:
type: added
......@@ -33,7 +33,8 @@ RSpec.describe GitlabSchema.types['Vulnerability'] do
merge_request
discussions
confirmed_by
resolved_by]
resolved_by
dismissed_by]
end
before do
......
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