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:

image

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 ...

image

... 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

  1. Check out the branch.
  2. bundle exec rake gitlab:graphql:compile_docs
  3. Check out doc/api/graphql/reference/_index.md — you should see anchors on the individual rows like <a id="workitem-features"></a> for WorkItem's features, while the WorkItemFeatures! text in the same row links to #workitemfeatures.
  4. Using your docs-gitlab-com check out, hugo serve and check out http://localhost:1313/api/graphql/reference/#workitemfeatures. It should take you straight to the type itself, not the field!
  5. http://localhost:1313/api/graphql/reference/#workitem-features should take you to the field!
  6. 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.

Merge request reports

Loading