Commit 03a5f330 authored by Alex Kalderimis's avatar Alex Kalderimis

Change `queries` to `fields_of(type_name)`

This makes it completely explicit what the 'queries' are in this case.
parent 3adfa65f
......@@ -143,10 +143,9 @@ module Gitlab
graphql_interface_types.map { |t| t.merge(fields: t[:fields] + t[:connections]) }
end
# 'queries' are the fields of the Query type
def queries
def fields_of(type_name)
graphql_operation_types
.find { |type| type[:name] == 'Query' }
.find { |type| type[:name] == type_name }
.values_at(:fields, :connections)
.flatten
.then { |fields| sorted_by_name(fields) }
......
......@@ -26,8 +26,8 @@
The `Query` type contains the API's top-level entry points for all executable queries.
\
- queries.each do |query|
= render_full_field(query, heading_level: 3, owner: 'Query')
- fields_of('Query').each do |field|
= render_full_field(field, heading_level: 3, owner: 'Query')
\
:plain
......
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