Add GraphQL input types to new GraphQL docs
What does this MR do and why?
This MR adds GraphQL input types to the new GraphQL docs.
It is part of a series of MRs to move across the work in !130378 (closed) in smaller pieces.
Previous MRs:
| MR | Description |
|---|---|
| !243355 (merged) | Enums |
| !250737 (merged) | Scalars |
References
Split GraphQL API reference documentation into ... (#593121)
How to set up and validate locally
You can review the generated docs for this MR:
- Index https://docs.gitlab.com/upstream-review-mr-ee-251517/api/graphql/reference/experimental/
- Input types page https://docs.gitlab.com/upstream-review-mr-ee-251517/api/graphql/reference/experimental/input_objects/
Try changing a GraphQL input type locally, for example:
diff --git a/app/graphql/types/ci/variable_input_type.rb b/app/graphql/types/ci/variable_input_type.rb
index .. 100644
--- a/app/graphql/types/ci/variable_input_type.rb
+++ b/app/graphql/types/ci/variable_input_type.rb
@@ -4,7 +4,7 @@ module Types
class VariableInputType < BaseInputObject
graphql_name 'CiVariableInput'
- description 'Attributes for defining a CI/CD variable.'
+ description 'Attributes for defining a CI/CD variable. Test.'
argument :key, GraphQL::Types::String, description: 'Name of the variable.'Then run the check docs rake task:
bundle exec rake gitlab:graphql:docs:checkIt should detect that there are changes that haven't been committed to the compiled docs:
##########
#
# Experimental GraphQL documentation is outdated!
# Please update the documentation by running `bundle exec rake gitlab:graphql:docs:compile`.
#
##########Now compile the docs:
bundle exec rake gitlab:graphql:docs:compileIt should compile successfully:
Experimental documentation compiled.And run :check again, it should pass this time:
Experimental GraphQL documentation is up to date.Check that the change to doc/api/graphql/reference/experimental/input_objects.md looks correct:
(Note you'll see changes to enums.md - that's fine - ignore those here, just look at input_objects.md)
git diff doc/api/graphql/reference/experimental/input_objects.mdThe diff should be:
diff --git a/doc/api/graphql/reference/experimental/input_objects.md b/doc/api/graphql/reference/experimental/input_objects.md
--- a/doc/api/graphql/reference/experimental/input_objects.md
+++ b/doc/api/graphql/reference/experimental/input_objects.md
@@ ## `CiVariableInput`
-Attributes for defining a CI/CD variable.
+Attributes for defining a CI/CD variable. Test.MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #593121