Commit 2262bd1c authored by Jarka Košanová's avatar Jarka Košanová

Add confidential to graphQL for notes creation

- optional confidentional param
- update the documentation
parent 362fa7b9
......@@ -18,6 +18,11 @@ module Mutations
required: true,
description: copy_field_description(Types::Notes::NoteType, :body)
argument :confidential,
GraphQL::BOOLEAN_TYPE,
required: false,
description: 'The confidentiality flag of a note. Default is false.'
def resolve(args)
noteable = authorized_find!(id: args[:noteable_id])
......@@ -40,7 +45,8 @@ module Mutations
def create_note_params(noteable, args)
{
noteable: noteable,
note: args[:body]
note: args[:body],
confidential: args[:confidential]
}
end
end
......
---
title: Add confidential attribute to graphQL for notes creation
merge_request: 36799
author:
type: added
......@@ -1691,6 +1691,11 @@ input CreateDiffNoteInput {
"""
clientMutationId: String
"""
The confidentiality flag of a note. Default is false.
"""
confidential: Boolean
"""
The global id of the resource to add a note to
"""
......@@ -1816,6 +1821,11 @@ input CreateImageDiffNoteInput {
"""
clientMutationId: String
"""
The confidentiality flag of a note. Default is false.
"""
confidential: Boolean
"""
The global id of the resource to add a note to
"""
......@@ -1916,6 +1926,11 @@ input CreateNoteInput {
"""
clientMutationId: String
"""
The confidentiality flag of a note. Default is false.
"""
confidential: Boolean
"""
The global id of the discussion this note is in reply to
"""
......
......@@ -4496,6 +4496,16 @@
},
"defaultValue": null
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
"name": "position",
"description": "The position of this note on a diff",
......@@ -4834,6 +4844,16 @@
},
"defaultValue": null
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
"name": "position",
"description": "The position of this note on a diff",
......@@ -5106,6 +5126,16 @@
},
"defaultValue": null
},
{
"name": "confidential",
"description": "The confidentiality flag of a note. Default is false.",
"type": {
"kind": "SCALAR",
"name": "Boolean",
"ofType": null
},
"defaultValue": null
},
{
"name": "discussionId",
"description": "The global id of the discussion this note is in reply to",
......@@ -13,7 +13,8 @@ RSpec.describe 'Adding a Note' do
variables = {
noteable_id: GitlabSchema.id_from_object(noteable).to_s,
discussion_id: (GitlabSchema.id_from_object(discussion).to_s if discussion),
body: 'Body text'
body: 'Body text',
confidential: true
}
graphql_mutation(:create_note, variables)
......@@ -40,6 +41,7 @@ RSpec.describe 'Adding a Note' do
post_graphql_mutation(mutation, current_user: current_user)
expect(mutation_response['note']['body']).to eq('Body text')
expect(mutation_response['note']['confidential']).to eq(true)
end
describe 'creating Notes in reply to a discussion' 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