Class: GraphQL::Schema::Printer::TypeKindPrinters::ObjectPrinter

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

Class Method Summary collapse

Methods included from FieldPrinter

print_args, print_fields, print_input_value, print_value

Class Method Details



106
107
108
109
110
111
112
113
# File 'lib/graphql/schema/printer.rb', line 106

def self.print(type)
  if type.interfaces.any?
    implementations = " implements #{type.interfaces.map(&:to_s).join(", ")}"
  else
    implementations = nil
  end
  "type #{type.name}#{implementations} {\n#{print_fields(type)}\n}"
end