Class: GraphQL::Schema::Printer::TypeKindPrinters::InputObjectPrinter

Inherits:
Object
  • Object
show all
Extended by:
DescriptionPrinter, FieldPrinter
Defined in:
lib/graphql/schema/printer.rb

Class Method Summary collapse

Methods included from FieldPrinter

print_fields

Methods included from DescriptionPrinter

print_description

Methods included from ArgsPrinter

#print_args, #print_input_value, #print_value

Methods included from DeprecatedPrinter

#print_deprecated

Class Method Details



327
328
329
330
331
332
333
334
335
# File 'lib/graphql/schema/printer.rb', line 327

def self.print(warden, type)
  arguments = warden.arguments(type)
  fields = arguments.sort_by(&:name).map.with_index{ |field, i|
    "#{print_description(field, "  ", i == 0)}"\
    "  #{print_input_value(field)}"
  }.join("\n")
  "#{print_description(type)}"\
  "input #{type.name} {\n#{fields}\n}"
end