Commit 1df4856c authored by Evan Read's avatar Evan Read

Merge branch '198573-alphabetise-graphql-api-doc-fields' into 'master'

Order fields in GraphQL API docs alphabetically

See merge request gitlab-org/gitlab!23661
parents be130b6e e5337c7e
This diff is collapsed.
......@@ -21,6 +21,10 @@ module Gitlab
MD
end
def sorted_fields(fields)
fields.sort_by { |field| field[:name] }
end
# Some fields types are arrays of other types and are displayed
# on docs wrapped in square brackets, for example: [String!].
# This makes GitLab docs renderer thinks they are links so here
......
......@@ -21,6 +21,6 @@ fields and methods on a model are available via GraphQL.
\
~ "| Name | Type | Description |"
~ "| --- | ---- | ---------- |"
- type[:fields].each do |field|
- sorted_fields(type[:fields]).each do |field|
= "| `#{field[:name]}` | #{render_field_type(field[:type][:info])} | #{field[:description]} |"
\
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