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