Commit 8460191c authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'fj-add-mode-field-to-snippet-blob-type' into 'master'

Add mode field to snippet blob in GraphQL

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