Add mode field to snippet blob in GraphQL

parent 254a7ef3
......@@ -40,6 +40,10 @@ module Types
field :rich_viewer, type: Types::Snippets::BlobViewerType,
description: 'Blob content rich viewer',
null: true
field :mode, type: GraphQL::STRING_TYPE,
description: 'Blob mode',
null: true
end
# rubocop: enable Graphql/AuthorizeTypes
end
......
---
title: Add mode field to snippet blob in GraphQL
merge_request: 24157
author:
type: changed
......@@ -6641,6 +6641,11 @@ type SnippetBlob {
"""
highlightedData: String
"""
Blob mode
"""
mode: String
"""
Blob name
"""
......
......@@ -7171,6 +7171,20 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "mode",
"description": "Blob mode",
"args": [
],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": "Blob name",
......
......@@ -1063,6 +1063,7 @@ Represents the snippet blob
| --- | ---- | ---------- |
| `binary` | Boolean! | Shows whether the blob is binary |
| `highlightedData` | String | Blob highlighted data |
| `mode` | String | Blob mode |
| `name` | String | Blob name |
| `path` | String | Blob path |
| `rawPath` | String! | Blob raw content endpoint path |
......
......@@ -6,7 +6,8 @@ describe GitlabSchema.types['SnippetBlob'] do
it 'has the correct fields' do
expected_fields = [:highlighted_data, :raw_path,
:size, :binary, :name, :path,
:simple_viewer, :rich_viewer]
:simple_viewer, :rich_viewer,
:mode]
is_expected.to have_graphql_fields(*expected_fields)
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