Fix overlapping anchors in generated GraphQL documentation
What does this MR do and why?
The GraphQL API reference has an anchor overlapping problem.
Take WorkItem's features field:
The type is WorkItemFeatures! — that links to #workitemfeatures. But that just links to the exact same place you started, since it's WorkItem's features field.
This also means that e.g. the WorkItemFeatures type in the sidebar ...
... doesn't take you to the type documentation; it takes you back to WorkItem's features. This repeats for any type whose name happens to equal a type+field combination in the same way.
This MR addresses this problem by putting a hyphen - between type and field names in fields' anchors. Type and field names never contain a hyphen themselves, so this disjoins the namespaces cleanly.
How to set up and validate locally
- Check out the branch.
bundle exec rake gitlab:graphql:compile_docs- Check out
doc/api/graphql/reference/_index.md— you should see anchors on the individual rows like<a id="workitem-features"></a>forWorkItem'sfeatures, while theWorkItemFeatures!text in the same row links to#workitemfeatures. - Using your docs-gitlab-com check out,
hugo serveand check out http://localhost:1313/api/graphql/reference/#workitemfeatures. It should take you straight to the type itself, not the field! - http://localhost:1313/api/graphql/reference/#workitem-features should take you to the field!
- Rejoice!
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.

