Method: GraphQL::Introspection::TypeType#fields

Defined in:
lib/graphql/introspection/type_type.rb

#fields(include_deprecated:) ⇒ Object



91
92
93
94
95
96
97
98
99
100
101
# File 'lib/graphql/introspection/type_type.rb', line 91

def fields(include_deprecated:)
  if !@object.kind.fields?
    nil
  else
    fields = @context.types.fields(@object)
    if !include_deprecated
      fields = fields.select {|f| !f.deprecation_reason }
    end
    fields.sort_by(&:name)
  end
end