Commit 1271dea1 authored by Alex Kalderimis's avatar Alex Kalderimis

Add mutation fields to GraphQL docs

Add extra null-check for mutation types.

This adds deprecation notices that were missing on mutations and
arguments.

Use English expansion of `e.g.`

Correct another lowercase heading

This includes removing periods after the name of the input type.
parent 907ddb55
...@@ -25,7 +25,7 @@ module Mutations ...@@ -25,7 +25,7 @@ module Mutations
default_value: Label::DEFAULT_COLOR, default_value: Label::DEFAULT_COLOR,
description: <<~DESC description: <<~DESC
The color of the label given in 6-digit hex notation with leading '#' sign The color of the label given in 6-digit hex notation with leading '#' sign
(e.g. `#FFAABB`) or one of the CSS color names (for example, `#FFAABB`) or one of the CSS color names
<https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords>. <https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords>.
DESC DESC
......
...@@ -63,7 +63,7 @@ module Gitlab ...@@ -63,7 +63,7 @@ module Gitlab
def render_full_field(field, heading_level: 3, owner: nil) def render_full_field(field, heading_level: 3, owner: nil)
conn = connection?(field) conn = connection?(field)
args = field[:arguments].reject { |f| conn && CONNECTION_ARGS.include?(f[:name]) } args = field[:arguments].reject { |arg| conn && CONNECTION_ARGS.include?(arg[:name]) }
arg_owner = [owner, field[:name]] arg_owner = [owner, field[:name]]
chunks = [ chunks = [
...@@ -370,7 +370,7 @@ module Gitlab ...@@ -370,7 +370,7 @@ module Gitlab
input_field = query[:input_fields]&.first input_field = query[:input_fields]&.first
return unless input_field return unless input_field
"Input type: `#{input_field[:type][:name]}`." "Input type: `#{input_field[:type][:name]}`"
end end
def deprecations def deprecations
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
:plain :plain
## `Mutation` type ## `Mutation` type
The `Mutation` type contains the API's top-level entry points for all executable mutations. The `Mutation` type contains all the mutations you can execute.
All mutations receive their arguments in a single input object named `input`, and all mutations All mutations receive their arguments in a single input object named `input`, and all mutations
support at least a return field `errors` containing a list of error messages. support at least a return field `errors` containing a list of error messages.
......
...@@ -414,7 +414,7 @@ RSpec.describe Gitlab::Graphql::Docs::Renderer do ...@@ -414,7 +414,7 @@ RSpec.describe Gitlab::Graphql::Docs::Renderer do
Make everything very pretty. Make everything very pretty.
Input type: `MakeItPrettyInput`. Input type: `MakeItPrettyInput`
#### Arguments #### Arguments
......
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