Class: GraphQL::ObjectType::Printer

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/graph_ql/object_type.rb

Overview

Print a type, using the query-style naming pattern

Instance Method Summary collapse

Instance Method Details



82
83
84
85
86
87
88
89
90
# File 'lib/graph_ql/object_type.rb', line 82

def print(type)
  if type.kind.non_null?
    "#{print(type.of_type)}!"
  elsif type.kind.list?
    "[#{print(type.of_type)}]"
  else
    type.name
  end
end