Foundational GraphQL docs compiling code, & enums
What does this MR do and why?
This MR adds the foundational compiling code, and rake tasks, for the new GraphQL docs.
It compiles just the enum page.
This is the first chunk of !130378 (closed) to merge to master.
References
Split GraphQL API reference documentation into ... (#593121)
How to set up and validate locally
See generated index page with enums https://docs.gitlab.com/upstream-review-mr-ee-243355/api/graphql/reference/experimental/.
The full set of changes from !130378 (closed) can be previewed at https://docs.gitlab.com/upstream-review-mr-ee-130378/api/graphql/reference/experimental.
Try changing a GraphQL enum locally, for example:
diff --git a/ee/app/graphql/types/ai/catalog/item_type_enum.rb b/ee/app/graphql/types/ai/catalog/item_type_enum.rb
index 42cc6cd2d20b..9a0757d89f3a 100644
--- a/ee/app/graphql/types/ai/catalog/item_type_enum.rb
+++ b/ee/app/graphql/types/ai/catalog/item_type_enum.rb
@@ -10,6 +10,10 @@ class ItemTypeEnum < BaseEnum
::Ai::Catalog::Item.item_types.each_key do |item_type|
value item_type.upcase, description: "#{item_type.humanize}.", value: item_type
end
+
+ value 'MY_VALUE', description: 'New value'
+ value 'EXPERIMENT', description: 'Experimental value', experiment: { milestone: '19.2' }
+ value 'DEPRECATED', description: 'Deprecated value', deprecated: { milestone: '19.2', reason: 'Replaced' }
end
end
endThen 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/enums.md looks correct:
diff --git a/doc/api/graphql/reference/experimental/enums.md b/doc/api/graphql/reference/experimental/enums.md
index 9e3f66c66fa9..7d7c6cc4235a 100644
--- a/doc/api/graphql/reference/experimental/enums.md
+++ b/doc/api/graphql/reference/experimental/enums.md
@@ -172,8 +172,11 @@ Possible item types for AI items.
| Value | Description |
| ----- | ----------- |
| `AGENT` | Agent. |
+| `DEPRECATED` | Deprecated in GitLab 19.2. Replaced. |
+| `EXPERIMENT` | Status: Experiment. Introduced in GitLab 19.2.<br/><br/>Experimental value. |
| `FLOW` | Flow. |
| `FOUNDATIONAL_AGENT` | Foundational agent. |
+| `MY_VALUE` | New value. |
| `THIRD_PARTY_FLOW` | Third party flow. |
## `AiCatalogItemVerificationLevel`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