Class: GraphQL::Language::Transform

Inherits:
Parslet::Transform
  • Object
show all
Defined in:
lib/graphql/language/transform.rb

Overview

Transform is a [parslet](kschiess.github.io/parslet/) transform for for turning the AST into objects in Nodes objects.

Constant Summary collapse

ESCAPES =
/\\(["\\\/bfnrt])/
UTF_8 =
/\\u[\da-f]{4}/i
UTF_8_REPLACE =
-> (m) { [m[-4..-1].to_i(16)].pack('U') }

Class Method Summary collapse

Class Method Details

.optional_sequence(name) ⇒ Object


11
12
13
14
# File 'lib/graphql/language/transform.rb', line 11

def self.optional_sequence(name)
  rule(name => simple(:val)) { [] }
  rule(name => sequence(:val)) { val }
end