Class: GraphQL::BaseType::Printer

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/graphql/base_type.rb

Overview

Print a type, using the query-style naming pattern

Instance Method Summary collapse

Instance Method Details



68
69
70
71
72
73
74
75
76
# File 'lib/graphql/base_type.rb', line 68

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