Commit 320fc2dd authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'ajk-add-url-to-note-type' into 'master'

Add Note.url field to GraphQL

See merge request gitlab-org/gitlab!51811
parents 35af9a19 6a89dfcd
...@@ -46,6 +46,13 @@ module Types ...@@ -46,6 +46,13 @@ module Types
field :confidential, GraphQL::BOOLEAN_TYPE, null: true, field :confidential, GraphQL::BOOLEAN_TYPE, null: true,
description: 'Indicates if this note is confidential', description: 'Indicates if this note is confidential',
method: :confidential? method: :confidential?
field :url, GraphQL::STRING_TYPE,
null: true,
description: 'URL to view this Note in the Web UI'
def url
::Gitlab::UrlBuilder.build(object)
end
def system_note_icon_name def system_note_icon_name
SystemNoteHelper.system_note_icon_name(object) if object.system? SystemNoteHelper.system_note_icon_name(object) if object.system?
......
...@@ -16165,6 +16165,11 @@ type Note implements ResolvableInterface { ...@@ -16165,6 +16165,11 @@ type Note implements ResolvableInterface {
""" """
updatedAt: Time! updatedAt: Time!
"""
URL to view this Note in the Web UI
"""
url: String
""" """
Permissions for the current user on the resource Permissions for the current user on the resource
""" """
......
...@@ -47750,6 +47750,20 @@ ...@@ -47750,6 +47750,20 @@
"isDeprecated": false, "isDeprecated": false,
"deprecationReason": null "deprecationReason": null
}, },
{
"name": "url",
"description": "URL to view this Note in the Web UI",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{ {
"name": "userPermissions", "name": "userPermissions",
"description": "Permissions for the current user on the resource", "description": "Permissions for the current user on the resource",
...@@ -2430,6 +2430,7 @@ Autogenerated return type of NamespaceIncreaseStorageTemporarily. ...@@ -2430,6 +2430,7 @@ Autogenerated return type of NamespaceIncreaseStorageTemporarily.
| `system` | Boolean! | Indicates whether this note was created by the system or by a user | | `system` | Boolean! | Indicates whether this note was created by the system or by a user |
| `systemNoteIconName` | String | Name of the icon corresponding to a system note | | `systemNoteIconName` | String | Name of the icon corresponding to a system note |
| `updatedAt` | Time! | Timestamp of the note's last activity | | `updatedAt` | Time! | Timestamp of the note's last activity |
| `url` | String | URL to view this Note in the Web UI |
| `userPermissions` | NotePermissions! | Permissions for the current user on the resource | | `userPermissions` | NotePermissions! | Permissions for the current user on the resource |
### NotePermissions ### NotePermissions
......
...@@ -22,6 +22,7 @@ RSpec.describe GitlabSchema.types['Note'] do ...@@ -22,6 +22,7 @@ RSpec.describe GitlabSchema.types['Note'] do
system_note_icon_name system_note_icon_name
updated_at updated_at
user_permissions user_permissions
url
] ]
expect(described_class).to have_graphql_fields(*expected_fields) expect(described_class).to have_graphql_fields(*expected_fields)
......
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