Method: GraphQL::Language::Printer#print
- Defined in:
- lib/graphql/language/printer.rb
#print(node, indent: "", truncate_size: nil) ⇒ String
Turn an arbitrary AST node back into a string.
54 55 56 57 58 59 60 61 |
# File 'lib/graphql/language/printer.rb', line 54 def print(node, indent: "", truncate_size: nil) truncate_size = truncate_size ? [truncate_size - OMISSION.size, 0].max : nil @out = TruncatableBuffer.new(truncate_size: truncate_size) print_node(node, indent: indent) @out.to_string rescue TruncatableBuffer::TruncateSizeReached @out.to_string << OMISSION end |