Class: GraphQL::Schema::Printer::TypeKindPrinters::EnumPrinter
- Inherits:
-
Object
- Object
- GraphQL::Schema::Printer::TypeKindPrinters::EnumPrinter
- Extended by:
- DeprecatedPrinter, DescriptionPrinter
- Defined in:
- lib/graphql/schema/printer.rb
Class Method Summary collapse
Methods included from DeprecatedPrinter
Methods included from DescriptionPrinter
Class Method Details
.print(warden, type) ⇒ Object
311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/graphql/schema/printer.rb', line 311 def self.print(warden, type) enum_values = warden.enum_values(type) values = enum_values.sort_by(&:name).map.with_index { |v, i| "#{print_description(v, ' ', i == 0)}"\ " #{v.name}#{print_deprecated(v)}" }.join("\n") "#{print_description(type)}"\ "enum #{type.name} {\n#{values}\n}" end |