graphql 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql.rb +31 -41
  3. data/lib/graphql/argument.rb +23 -21
  4. data/lib/graphql/base_type.rb +5 -8
  5. data/lib/graphql/define/assign_argument.rb +5 -2
  6. data/lib/graphql/define/type_definer.rb +2 -1
  7. data/lib/graphql/directive.rb +34 -36
  8. data/lib/graphql/directive/include_directive.rb +3 -7
  9. data/lib/graphql/directive/skip_directive.rb +3 -7
  10. data/lib/graphql/enum_type.rb +78 -76
  11. data/lib/graphql/execution_error.rb +1 -3
  12. data/lib/graphql/field.rb +99 -95
  13. data/lib/graphql/input_object_type.rb +49 -47
  14. data/lib/graphql/interface_type.rb +31 -34
  15. data/lib/graphql/introspection.rb +19 -18
  16. data/lib/graphql/introspection/directive_location_enum.rb +8 -0
  17. data/lib/graphql/introspection/directive_type.rb +1 -3
  18. data/lib/graphql/introspection/field_type.rb +1 -1
  19. data/lib/graphql/introspection/fields_field.rb +1 -1
  20. data/lib/graphql/introspection/introspection_query.rb +1 -3
  21. data/lib/graphql/introspection/possible_types_field.rb +7 -1
  22. data/lib/graphql/introspection/schema_field.rb +13 -9
  23. data/lib/graphql/introspection/type_by_name_field.rb +13 -17
  24. data/lib/graphql/introspection/typename_field.rb +12 -8
  25. data/lib/graphql/language.rb +5 -9
  26. data/lib/graphql/language/lexer.rb +668 -0
  27. data/lib/graphql/language/lexer.rl +149 -0
  28. data/lib/graphql/language/parser.rb +842 -116
  29. data/lib/graphql/language/parser.y +264 -0
  30. data/lib/graphql/language/token.rb +21 -0
  31. data/lib/graphql/list_type.rb +33 -31
  32. data/lib/graphql/non_null_type.rb +33 -31
  33. data/lib/graphql/object_type.rb +52 -55
  34. data/lib/graphql/query.rb +83 -80
  35. data/lib/graphql/query/context.rb +5 -1
  36. data/lib/graphql/query/directive_resolution.rb +16 -0
  37. data/lib/graphql/query/executor.rb +3 -3
  38. data/lib/graphql/query/input_validation_result.rb +17 -15
  39. data/lib/graphql/query/serial_execution.rb +5 -5
  40. data/lib/graphql/query/serial_execution/execution_context.rb +4 -3
  41. data/lib/graphql/query/serial_execution/selection_resolution.rb +19 -21
  42. data/lib/graphql/query/serial_execution/value_resolution.rb +1 -1
  43. data/lib/graphql/query/type_resolver.rb +22 -18
  44. data/lib/graphql/query/variable_validation_error.rb +14 -12
  45. data/lib/graphql/schema.rb +87 -77
  46. data/lib/graphql/schema/each_item_validator.rb +16 -12
  47. data/lib/graphql/schema/field_validator.rb +14 -10
  48. data/lib/graphql/schema/implementation_validator.rb +26 -22
  49. data/lib/graphql/schema/middleware_chain.rb +2 -1
  50. data/lib/graphql/schema/possible_types.rb +34 -0
  51. data/lib/graphql/schema/printer.rb +122 -120
  52. data/lib/graphql/schema/type_expression.rb +1 -0
  53. data/lib/graphql/schema/type_map.rb +3 -10
  54. data/lib/graphql/schema/type_reducer.rb +65 -81
  55. data/lib/graphql/schema/type_validator.rb +45 -41
  56. data/lib/graphql/static_validation.rb +7 -9
  57. data/lib/graphql/static_validation/all_rules.rb +29 -24
  58. data/lib/graphql/static_validation/arguments_validator.rb +39 -35
  59. data/lib/graphql/static_validation/literal_validator.rb +44 -40
  60. data/lib/graphql/static_validation/message.rb +30 -26
  61. data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +15 -11
  62. data/lib/graphql/static_validation/rules/arguments_are_defined.rb +14 -10
  63. data/lib/graphql/static_validation/rules/directives_are_defined.rb +16 -12
  64. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +59 -0
  65. data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +25 -21
  66. data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +28 -24
  67. data/lib/graphql/static_validation/rules/fields_will_merge.rb +84 -80
  68. data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +49 -43
  69. data/lib/graphql/static_validation/rules/fragment_types_exist.rb +22 -17
  70. data/lib/graphql/static_validation/rules/fragments_are_finite.rb +19 -15
  71. data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +25 -20
  72. data/lib/graphql/static_validation/rules/fragments_are_used.rb +36 -23
  73. data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +29 -25
  74. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +21 -17
  75. data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +79 -70
  76. data/lib/graphql/static_validation/rules/variables_are_input_types.rb +24 -20
  77. data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +122 -119
  78. data/lib/graphql/static_validation/type_stack.rb +138 -129
  79. data/lib/graphql/static_validation/validator.rb +29 -25
  80. data/lib/graphql/type_kinds.rb +42 -40
  81. data/lib/graphql/union_type.rb +22 -16
  82. data/lib/graphql/version.rb +1 -1
  83. data/readme.md +12 -27
  84. data/spec/graphql/base_type_spec.rb +3 -3
  85. data/spec/graphql/directive_spec.rb +10 -18
  86. data/spec/graphql/enum_type_spec.rb +7 -7
  87. data/spec/graphql/execution_error_spec.rb +1 -1
  88. data/spec/graphql/field_spec.rb +14 -13
  89. data/spec/graphql/id_type_spec.rb +6 -6
  90. data/spec/graphql/input_object_type_spec.rb +39 -39
  91. data/spec/graphql/interface_type_spec.rb +16 -32
  92. data/spec/graphql/introspection/directive_type_spec.rb +5 -9
  93. data/spec/graphql/introspection/input_value_type_spec.rb +10 -4
  94. data/spec/graphql/introspection/introspection_query_spec.rb +2 -2
  95. data/spec/graphql/introspection/schema_type_spec.rb +2 -2
  96. data/spec/graphql/introspection/type_type_spec.rb +34 -6
  97. data/spec/graphql/language/parser_spec.rb +299 -105
  98. data/spec/graphql/language/visitor_spec.rb +4 -4
  99. data/spec/graphql/list_type_spec.rb +11 -11
  100. data/spec/graphql/object_type_spec.rb +10 -10
  101. data/spec/graphql/query/arguments_spec.rb +7 -7
  102. data/spec/graphql/query/context_spec.rb +11 -3
  103. data/spec/graphql/query/executor_spec.rb +26 -19
  104. data/spec/graphql/query/serial_execution/execution_context_spec.rb +6 -6
  105. data/spec/graphql/query/serial_execution/value_resolution_spec.rb +2 -2
  106. data/spec/graphql/query/type_resolver_spec.rb +3 -3
  107. data/spec/graphql/query_spec.rb +6 -38
  108. data/spec/graphql/scalar_type_spec.rb +28 -19
  109. data/spec/graphql/schema/field_validator_spec.rb +1 -1
  110. data/spec/graphql/schema/middleware_chain_spec.rb +12 -1
  111. data/spec/graphql/schema/printer_spec.rb +12 -4
  112. data/spec/graphql/schema/rescue_middleware_spec.rb +1 -1
  113. data/spec/graphql/schema/type_expression_spec.rb +2 -2
  114. data/spec/graphql/schema/type_reducer_spec.rb +21 -36
  115. data/spec/graphql/schema/type_validator_spec.rb +9 -9
  116. data/spec/graphql/schema_spec.rb +1 -1
  117. data/spec/graphql/static_validation/rules/argument_literals_are_compatible_spec.rb +4 -4
  118. data/spec/graphql/static_validation/rules/arguments_are_defined_spec.rb +4 -4
  119. data/spec/graphql/static_validation/rules/directives_are_defined_spec.rb +5 -5
  120. data/spec/graphql/static_validation/rules/directives_are_in_valid_locations_spec.rb +39 -0
  121. data/spec/graphql/static_validation/rules/fields_are_defined_on_type_spec.rb +5 -5
  122. data/spec/graphql/static_validation/rules/fields_have_appropriate_selections_spec.rb +4 -4
  123. data/spec/graphql/static_validation/rules/fields_will_merge_spec.rb +2 -2
  124. data/spec/graphql/static_validation/rules/fragment_spreads_are_possible_spec.rb +1 -1
  125. data/spec/graphql/static_validation/rules/fragment_types_exist_spec.rb +2 -2
  126. data/spec/graphql/static_validation/rules/fragments_are_finite_spec.rb +2 -2
  127. data/spec/graphql/static_validation/rules/fragments_are_on_composite_types_spec.rb +2 -2
  128. data/spec/graphql/static_validation/rules/fragments_are_used_spec.rb +3 -3
  129. data/spec/graphql/static_validation/rules/required_arguments_are_present_spec.rb +3 -3
  130. data/spec/graphql/static_validation/rules/variable_default_values_are_correctly_typed_spec.rb +5 -5
  131. data/spec/graphql/static_validation/rules/variable_usages_are_allowed_spec.rb +3 -1
  132. data/spec/graphql/static_validation/rules/variables_are_input_types_spec.rb +4 -4
  133. data/spec/graphql/static_validation/rules/variables_are_used_and_defined_spec.rb +3 -3
  134. data/spec/graphql/static_validation/type_stack_spec.rb +3 -2
  135. data/spec/graphql/static_validation/validator_spec.rb +26 -6
  136. data/spec/graphql/union_type_spec.rb +5 -4
  137. data/spec/spec_helper.rb +2 -5
  138. data/spec/support/dairy_app.rb +30 -9
  139. data/spec/support/dairy_data.rb +1 -1
  140. data/spec/support/star_wars_data.rb +26 -26
  141. data/spec/support/star_wars_schema.rb +1 -1
  142. metadata +40 -21
  143. data/lib/graphql/language/transform.rb +0 -113
  144. data/lib/graphql/query/directive_chain.rb +0 -44
  145. data/lib/graphql/repl.rb +0 -27
  146. data/spec/graphql/language/transform_spec.rb +0 -156
@@ -0,0 +1,149 @@
1
+ %%{
2
+ machine graphql_lexer;
3
+
4
+ IDENTIFIER = [_A-Za-z][_0-9A-Za-z]*;
5
+ NEWLINE = [\c\r\n];
6
+ BLANK = [, \t]+;
7
+ COMMENT = '#' [^\n\r]*;
8
+ INT = '-'? ('0'|[1-9][0-9]*);
9
+ FLOAT_DECIMAL = '.'[0-9]+;
10
+ FLOAT_EXP = ('e' | 'E')?('+' | '-')?[0-9]+;
11
+ FLOAT = INT FLOAT_DECIMAL? FLOAT_EXP?;
12
+ ON = 'on';
13
+ FRAGMENT = 'fragment';
14
+ TRUE = 'true';
15
+ FALSE = 'false';
16
+ RCURLY = '{';
17
+ LCURLY = '}';
18
+ RPAREN = '(';
19
+ LPAREN = ')';
20
+ RBRACKET = '[';
21
+ LBRACKET = ']';
22
+ COLON = ':';
23
+ QUOTE = '"';
24
+ ESCAPED_QUOTE = '\\"';
25
+ STRING_CHAR = (ESCAPED_QUOTE | ^'"');
26
+ VAR_SIGN = '$';
27
+ DIR_SIGN = '@';
28
+ ELLIPSIS = '...';
29
+ EQUALS = '=';
30
+ BANG = '!';
31
+
32
+ QUOTED_STRING = QUOTE STRING_CHAR* QUOTE;
33
+
34
+ main := |*
35
+ INT => { emit_token.call(:INT) };
36
+ FLOAT => { emit_token.call(:FLOAT) };
37
+ ON => { emit_token.call(:ON) };
38
+ FRAGMENT => { emit_token.call(:FRAGMENT) };
39
+ TRUE => { emit_token.call(:TRUE) };
40
+ FALSE => { emit_token.call(:FALSE) };
41
+ RCURLY => { emit_token.call(:RCURLY) };
42
+ LCURLY => { emit_token.call(:LCURLY) };
43
+ RPAREN => { emit_token.call(:RPAREN) };
44
+ LPAREN => { emit_token.call(:LPAREN) };
45
+ RBRACKET => { emit_token.call(:RBRACKET) };
46
+ LBRACKET => { emit_token.call(:LBRACKET) };
47
+ COLON => { emit_token.call(:COLON) };
48
+ QUOTED_STRING => { emit_string(ts + 1, te - 1, meta) };
49
+ VAR_SIGN => { emit_token.call(:VAR_SIGN) };
50
+ DIR_SIGN => { emit_token.call(:DIR_SIGN) };
51
+ ELLIPSIS => { emit_token.call(:ELLIPSIS) };
52
+ EQUALS => { emit_token.call(:EQUALS) };
53
+ BANG => { emit_token.call(:BANG) };
54
+ IDENTIFIER => { emit_token.call(:IDENTIFIER) };
55
+
56
+ NEWLINE => {
57
+ meta[:line] += 1
58
+ meta[:col] = 1
59
+ };
60
+
61
+ BLANK => { meta[:col] += te - ts };
62
+ COMMENT => { meta[:col] += te - ts };
63
+
64
+ *|;
65
+ }%%
66
+
67
+
68
+ module GraphQL
69
+ module Language
70
+ module Lexer
71
+ def self.tokenize(query_string)
72
+ run_lexer(query_string)
73
+ end
74
+
75
+ # Replace any escaped unicode or whitespace with the _actual_ characters
76
+ # To avoid allocating more strings, this modifies the string passed into it
77
+ def self.replace_escaped_characters_in_place(raw_string)
78
+ raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
79
+ raw_string.gsub!(UTF_8, &UTF_8_REPLACE)
80
+ nil
81
+ end
82
+
83
+ private
84
+
85
+ %% write data;
86
+
87
+ def self.run_lexer(query_string)
88
+ data = query_string.unpack("c*")
89
+ eof = data.length
90
+
91
+ meta = {
92
+ line: 1,
93
+ col: 1,
94
+ data: data,
95
+ tokens: []
96
+ }
97
+
98
+ %% write init;
99
+
100
+ emit_token = -> (name) {
101
+ emit(name, ts, te, meta)
102
+ }
103
+
104
+ %% write exec;
105
+
106
+ meta[:tokens]
107
+ end
108
+
109
+ def self.emit(token_name, ts, te, meta)
110
+ meta[:tokens] << GraphQL::Language::Token.new(
111
+ name: token_name,
112
+ value: meta[:data][ts...te].pack("c*"),
113
+ line: meta[:line],
114
+ col: meta[:col],
115
+ )
116
+ # Bump the column counter for the next token
117
+ meta[:col] += te - ts
118
+ end
119
+
120
+ ESCAPES = /\\["\\\/bfnrt]/
121
+ ESCAPES_REPLACE = {
122
+ '\\"' => '"',
123
+ "\\\\" => "\\",
124
+ "\\/" => '/',
125
+ "\\b" => "\b",
126
+ "\\f" => "\f",
127
+ "\\n" => "\n",
128
+ "\\r" => "\r",
129
+ "\\t" => "\t",
130
+ }
131
+
132
+ UTF_8 = /\\u[\dAa-f]{4}/i
133
+ UTF_8_REPLACE = -> (m) { [m[-4..-1].to_i(16)].pack('U'.freeze) }
134
+
135
+ def self.emit_string(ts, te, meta)
136
+ value = meta[:data][ts...te].pack("c*").force_encoding("UTF-8")
137
+ replace_escaped_characters_in_place(value)
138
+
139
+ meta[:tokens] << GraphQL::Language::Token.new(
140
+ name: :STRING,
141
+ value: value,
142
+ line: meta[:line],
143
+ col: meta[:col],
144
+ )
145
+ meta[:col] += te - ts
146
+ end
147
+ end
148
+ end
149
+ end
@@ -1,121 +1,847 @@
1
+ #
2
+ # DO NOT MODIFY!!!!
3
+ # This file is automatically generated by Racc 1.4.14
4
+ # from Racc grammer file "".
5
+ #
6
+
7
+ require 'racc/parser.rb'
8
+
9
+
10
+
1
11
  module GraphQL
2
12
  module Language
3
- # Parser is a [parslet](http://kschiess.github.io/parslet/) parser for parsing queries.
4
- #
5
- class Parser < Parslet::Parser
6
- root(:document)
7
- rule(:document) { (
8
- space |
9
- operation_definition |
10
- fragment_definition
11
- ).repeat.as(:document_parts)
12
- }
13
-
14
- # TODO: whitespace sensitive regarding `on`, eg `onFood`, see lookahead note in spec
15
- rule(:fragment_definition) {
16
- str("fragment").as(:fragment_keyword) >>
17
- space? >> name.as(:fragment_name) >>
18
- space? >> str("on") >> space? >> name.as(:type_condition) >>
19
- space? >> directives.maybe.as(:optional_directives).as(:directives) >>
20
- space? >> selections.as(:selections)
21
- }
22
-
23
- rule(:fragment_spread) {
24
- spread.as(:fragment_spread_keyword) >> space? >>
25
- name.as(:fragment_spread_name) >> space? >>
26
- directives.maybe.as(:optional_directives).as(:directives)
27
- }
28
- rule(:spread) { str("...") }
29
- # TODO: `on` bug, see spec
30
- rule(:inline_fragment) {
31
- spread.as(:fragment_spread_keyword) >> space? >>
32
- str("on ") >> name.as(:inline_fragment_type) >> space? >>
33
- directives.maybe.as(:optional_directives).as(:directives) >> space? >>
34
- selections.as(:selections)
35
- }
36
-
37
- rule(:operation_definition) { (unnamed_selections | typed_operation_definition) }
38
- rule(:unnamed_selections) { selections.as(:unnamed_selections)}
39
- rule(:typed_operation_definition) {
40
- operation_type.as(:operation_type) >> space? >>
41
- name.maybe.as(:name) >> space? >>
42
- operation_variable_definitions.maybe.as(:optional_variables).as(:variables) >> space? >>
43
- directives.maybe.as(:optional_directives).as(:directives) >> space? >>
44
- selections.as(:selections)
45
- }
46
- rule(:operation_type) { (str("query") | str("mutation") | str("subscription")) }
47
- rule(:operation_variable_definitions) { str("(") >> space? >> (operation_variable_definition >> separator?).repeat(1) >> space? >> str(")") }
48
- rule(:operation_variable_definition) {
49
- value_variable.as(:variable_name) >> space? >>
50
- str(":") >> space? >>
51
- type.as(:variable_type) >> space? >>
52
- (str("=") >> space? >> value.as(:variable_default_value)).maybe.as(:variable_optional_default_value)
53
- }
54
-
55
- rule(:selection) { (inline_fragment | fragment_spread | field) >> space? >> separator? }
56
- rule(:selections) { str("{") >> space? >> selection.repeat(1) >> space? >> str("}")}
57
-
58
- rule(:field) {
59
- field_alias.maybe.as(:alias) >>
60
- name.as(:field_name) >>
61
- field_arguments.maybe.as(:optional_field_arguments).as(:field_arguments) >> space? >>
62
- directives.maybe.as(:optional_directives).as(:directives) >> space? >>
63
- selections.maybe.as(:optional_selections).as(:selections)
64
- }
65
-
66
- rule(:field_alias) { name.as(:alias_name) >> space? >> str(":") >> space? }
67
- rule(:field_arguments) { str("(") >> space? >> field_argument.repeat(1) >> space? >> str(")") }
68
- rule(:field_argument) { name.as(:field_argument_name) >> str(":") >> space? >> value.as(:field_argument_value) >> separator? }
69
-
70
- rule(:directives) { (directive >> separator?).repeat(1) }
71
- rule(:directive) {
72
- str("@") >> name.as(:directive_name) >>
73
- directive_arguments.maybe.as(:optional_directive_arguments).as(:directive_arguments)
74
- }
75
- rule(:directive_arguments) { str("(") >> directive_argument.repeat(1) >> str(")") }
76
- rule(:directive_argument) { name.as(:directive_argument_name) >> str(":") >> space? >> value.as(:directive_argument_value) >> separator? }
77
-
78
- rule(:type) { (non_null_type | list_type | type_name)}
79
- rule(:list_type) { str("[") >> type.as(:list_type) >> str("]")}
80
- rule(:non_null_type) { (list_type | type_name).as(:non_null_type) >> str("!") }
81
- rule(:type_name) { name.as(:type_name) }
82
-
83
- rule(:value) {(
84
- value_input_object |
85
- value_float |
86
- value_int |
87
- value_string |
88
- value_boolean |
89
- value_array |
90
- value_variable |
91
- value_enum
92
- )}
93
- rule(:value_sign?) { match('[\-\+]').maybe }
94
- rule(:value_array) { (str("[") >> space? >> (value >> separator?).repeat(0) >> str("]")).as(:array) }
95
- rule(:value_boolean) { (str("true") | str("false")).as(:boolean) }
96
- rule(:value_float) { (value_sign? >> match('\d').repeat(1) >> str(".") >> match('\d').repeat(1) >> (match("[eE]") >> value_sign? >> match('\d').repeat(1)).maybe).as(:float) }
97
- rule(:value_input_object) { str("{") >> space? >> value_input_object_pair.repeat(0).as(:input_object) >> space? >> str("}") }
98
- rule(:value_input_object_pair) { space? >> name.as(:input_object_name) >> space? >> str(":") >> space? >> value.as(:input_object_value) >> separator? }
99
- rule(:value_int) { (value_sign? >> match('\d').repeat(1)).as(:int) }
100
- rule(:value_string) { str('"') >> value_string_char.repeat.maybe.as(:optional_string_content).as(:string) >> str('"')}
101
- rule(:value_string_char) { value_string_escaped_char | value_string_escaped_unicode | value_string_source_char}
102
- rule(:value_string_escaped_char) { str("\\") >> match('["\\\\/bfnrt]') }
103
- rule(:value_string_escaped_unicode) { str("\\") >> match('u[\dA-Fa-f]{4}')}
104
- rule(:value_string_source_char) { (str('"') | str("\\") | value_string_line_terminator).absent? >> any }
105
- rule(:value_string_line_terminator) {
106
- str('\u000A') | # new line
107
- str('\u000D') | # carriage return
108
- str('\u2028') | # line separator
109
- str('\u2029') # paragraph separator
110
- }
111
- rule(:value_enum) { name.as(:enum) }
112
- rule(:value_variable) { str("$") >> name.as(:variable) }
113
-
114
- rule(:separator?) { space? >> str(",").maybe >> space? }
115
- rule(:name) { match('[_A-Za-z]') >> match('[_0-9A-Za-z]').repeat(0) }
116
- rule(:comment) { str("#") >> match('[^\r\n]').repeat(0) }
117
- rule(:space) { (match('[\s\n]+') | comment).repeat(1) }
118
- rule(:space?) { space.maybe }
13
+ class Parser < Racc::Parser
14
+
15
+ module_eval(<<'...end parser.y/module_eval...', 'parser.y', 211)
16
+
17
+ def initialize(query_string)
18
+ @query_string = query_string
19
+ end
20
+
21
+ def parse_document
22
+ @document ||= begin
23
+ @tokens ||= GraphQL::Language::Lexer.tokenize(@query_string)
24
+ if @tokens.none?
25
+ make_node(:Document, definitions: [])
26
+ else
27
+ do_parse
28
+ end
29
+ end
30
+ end
31
+
32
+ def self.parse(query_string)
33
+ self.new(query_string).parse_document
34
+ end
35
+
36
+ private
37
+
38
+ def next_token
39
+ lexer_token = @tokens.shift
40
+ if lexer_token.nil?
41
+ nil
42
+ else
43
+ [lexer_token.name, lexer_token]
44
+ end
45
+ end
46
+
47
+ def on_error(parser_token_id, lexer_token, vstack)
48
+ if lexer_token == "$"
49
+ raise GraphQL::ParseError.new("Unexpected end of document", nil, nil, @query_string)
50
+ else
51
+ parser_token_name = token_to_str(parser_token_id)
52
+ if parser_token_name.nil?
53
+ raise GraphQL::ParseError.new("Parse Error on unknown token: {token_id: #{parser_token_id}, lexer_token: #{lexer_token}} from #{@query_string}", nil, nil, @query_string)
54
+ else
55
+ line, col = lexer_token.line_and_column
56
+ raise GraphQL::ParseError.new("Parse error on #{lexer_token.to_s.inspect} (#{parser_token_name}) at [#{line}, #{col}]", line, col, @query_string)
57
+ end
58
+ end
59
+ end
60
+
61
+ def make_node(node_name, assigns)
62
+ assigns.each do |key, value|
63
+ if key != :position_source && value.is_a?(GraphQL::Language::Token)
64
+ assigns[key] = value.to_s
119
65
  end
120
66
  end
67
+
68
+ GraphQL::Language::Nodes.const_get(node_name).new(assigns)
69
+ end
70
+ ...end parser.y/module_eval...
71
+ ##### State transition tables begin ###
72
+
73
+ racc_action_table = [
74
+ 85, 36, 104, 86, 35, 105, 87, 104, 88, 113,
75
+ 79, 80, 40, 76, 77, 78, 85, 61, 47, 86,
76
+ 69, 40, 87, 36, 88, 43, 79, 80, 73, 76,
77
+ 77, 78, 85, 40, 36, 86, 9, 9, 87, 31,
78
+ 88, 9, 79, 80, 9, 76, 77, 78, 85, 29,
79
+ 40, 86, 107, 9, 87, 9, 88, 40, 79, 80,
80
+ 40, 76, 77, 78, 85, 111, 15, 86, 96, 47,
81
+ 87, 50, 88, 40, 79, 80, 67, 76, 77, 78,
82
+ 10, 19, 12, 13, 14, 10, 19, 12, 13, 14,
83
+ 20, 10, 19, 12, 13, 14, nil, nil, nil, nil,
84
+ 27, 32, 10, 19, 12, 13, 14, 93, nil, nil,
85
+ nil, 27, 10, 19, 12, 13, 14, 93, nil, nil,
86
+ nil, nil, 10, 19, 12, 13, 14, 10, 19, 12,
87
+ 13, 37, nil, nil, 9, 40, 10, 11, 12, 13,
88
+ 14, 9, nil, 10, 11, 12, 13, 14, 109, 10,
89
+ 19, 12, 13, 14, 99, 10, 19, 12, 13, 14,
90
+ 10, 19, 12, 13, 14, 10, 19, 12, 13, 14,
91
+ 10, 19, 12, 13, 14, 10, 19, 12, 13, 14,
92
+ 10, 19, 12, 13, 14, 10, 19, 12, 13, 14,
93
+ 10, 19, 12, 13, 14, 10, 19, 12, 13, 14 ]
94
+
95
+ racc_action_check = [
96
+ 111, 26, 91, 111, 26, 91, 111, 106, 111, 106,
97
+ 111, 111, 59, 111, 111, 111, 105, 45, 45, 105,
98
+ 53, 54, 105, 56, 105, 28, 105, 105, 63, 105,
99
+ 105, 105, 69, 66, 49, 69, 70, 72, 69, 17,
100
+ 69, 74, 69, 69, 48, 69, 69, 69, 97, 15,
101
+ 30, 97, 97, 44, 97, 42, 97, 41, 97, 97,
102
+ 38, 97, 97, 97, 86, 102, 1, 86, 86, 31,
103
+ 86, 36, 86, 34, 86, 86, 51, 86, 86, 86,
104
+ 36, 36, 36, 36, 36, 51, 51, 51, 51, 51,
105
+ 9, 9, 9, 9, 9, 9, nil, nil, nil, nil,
106
+ 9, 21, 21, 21, 21, 21, 21, 73, nil, nil,
107
+ nil, 21, 73, 73, 73, 73, 73, 93, nil, nil,
108
+ nil, nil, 93, 93, 93, 93, 93, 27, 27, 27,
109
+ 27, 27, nil, nil, 3, 27, 3, 3, 3, 3,
110
+ 3, 0, nil, 0, 0, 0, 0, 0, 100, 100,
111
+ 100, 100, 100, 100, 87, 87, 87, 87, 87, 87,
112
+ 47, 47, 47, 47, 47, 37, 37, 37, 37, 37,
113
+ 85, 85, 85, 85, 85, 40, 40, 40, 40, 40,
114
+ 7, 7, 7, 7, 7, 35, 35, 35, 35, 35,
115
+ 43, 43, 43, 43, 43, 11, 11, 11, 11, 11 ]
116
+
117
+ racc_action_pointer = [
118
+ 131, 66, nil, 124, nil, nil, nil, 168, nil, 79,
119
+ nil, 183, nil, nil, nil, 49, nil, 37, nil, nil,
120
+ nil, 90, nil, nil, nil, nil, -1, 115, 9, nil,
121
+ 30, 65, nil, nil, 53, 173, 68, 153, 40, nil,
122
+ 163, 37, 45, 178, 43, 14, nil, 148, 34, 32,
123
+ nil, 73, nil, 15, 1, nil, 21, nil, nil, -8,
124
+ nil, nil, nil, 23, nil, nil, 13, nil, nil, 28,
125
+ 26, nil, 27, 100, 31, nil, nil, nil, nil, nil,
126
+ nil, nil, nil, nil, nil, 158, 60, 143, nil, nil,
127
+ nil, -4, nil, 110, nil, nil, nil, 44, nil, nil,
128
+ 137, nil, 60, nil, nil, 12, 1, nil, nil, nil,
129
+ nil, -4, nil, nil, nil ]
130
+
131
+ racc_action_default = [
132
+ -72, -72, -1, -2, -3, -5, -6, -9, -8, -72,
133
+ -32, -33, -34, -35, -36, -72, -4, -11, -10, -33,
134
+ -21, -72, -25, -27, -28, -29, -37, -63, -72, 115,
135
+ -63, -72, -22, -26, -63, -72, -72, -36, -64, -65,
136
+ -72, -63, -72, -72, -72, -72, -13, -72, -23, -37,
137
+ -38, -72, -40, -72, -63, -66, -37, -68, -70, -63,
138
+ -7, -12, -14, -72, -24, -30, -63, -39, -41, -72,
139
+ -72, -67, -72, -72, -23, -42, -43, -44, -45, -46,
140
+ -47, -48, -49, -50, -51, -72, -72, -72, -62, -69,
141
+ -71, -19, -16, -72, -31, -52, -53, -72, -55, -57,
142
+ -72, -59, -72, -15, -17, -72, -72, -54, -56, -58,
143
+ -60, -72, -20, -18, -61 ]
144
+
145
+ racc_goto_table = [
146
+ 18, 34, 26, 46, 28, 4, 75, 58, 16, 60,
147
+ 22, 103, 65, 64, 26, 45, 21, 62, 42, 30,
148
+ 41, 44, 33, 98, 66, 48, 91, 17, 49, 53,
149
+ 54, 71, 57, 56, 108, 89, 59, 90, 94, 64,
150
+ 63, 52, 112, 1, 53, 70, 106, 101, 114, 51,
151
+ 72, 3, 97, 100, 2, 55, 68, 74, nil, nil,
152
+ 110, nil, nil, nil, nil, nil, 92, nil, nil, nil,
153
+ nil, nil, nil, nil, nil, nil, nil, nil, 95, nil,
154
+ 102, nil, nil, nil, nil, nil, 92, nil, nil, nil,
155
+ nil, nil, nil, 102 ]
156
+
157
+ racc_goto_check = [
158
+ 7, 23, 7, 13, 7, 4, 16, 11, 4, 11,
159
+ 19, 15, 18, 11, 7, 12, 17, 13, 10, 9,
160
+ 7, 10, 19, 16, 23, 10, 14, 8, 7, 7,
161
+ 7, 23, 10, 7, 16, 11, 7, 11, 18, 11,
162
+ 7, 25, 16, 1, 7, 10, 14, 32, 16, 24,
163
+ 10, 3, 30, 31, 2, 34, 25, 10, nil, nil,
164
+ 32, nil, nil, nil, nil, nil, 7, nil, nil, nil,
165
+ nil, nil, nil, nil, nil, nil, nil, nil, 7, nil,
166
+ 7, nil, nil, nil, nil, nil, 7, nil, nil, nil,
167
+ nil, nil, nil, 7 ]
168
+
169
+ racc_goto_pointer = [
170
+ nil, 43, 54, 51, 5, nil, nil, -7, 20, 2,
171
+ -9, -35, -16, -28, -47, -80, -63, 7, -36, 1,
172
+ nil, nil, nil, -25, 13, 5, nil, nil, nil, nil,
173
+ -34, -34, -40, nil, 17 ]
174
+
175
+ racc_goto_default = [
176
+ nil, nil, nil, nil, nil, 5, 6, 7, nil, nil,
177
+ nil, 8, nil, nil, nil, nil, nil, nil, nil, nil,
178
+ 23, 24, 25, nil, nil, nil, 81, 82, 83, 84,
179
+ nil, nil, nil, 38, 39 ]
180
+
181
+ racc_reduce_table = [
182
+ 0, 0, :racc_error,
183
+ 1, 23, :_reduce_none,
184
+ 1, 24, :_reduce_2,
185
+ 1, 25, :_reduce_3,
186
+ 2, 25, :_reduce_4,
187
+ 1, 26, :_reduce_none,
188
+ 1, 26, :_reduce_none,
189
+ 5, 27, :_reduce_7,
190
+ 1, 27, :_reduce_8,
191
+ 0, 30, :_reduce_9,
192
+ 1, 30, :_reduce_none,
193
+ 0, 31, :_reduce_11,
194
+ 3, 31, :_reduce_12,
195
+ 1, 34, :_reduce_13,
196
+ 2, 34, :_reduce_14,
197
+ 5, 35, :_reduce_15,
198
+ 1, 36, :_reduce_16,
199
+ 2, 36, :_reduce_17,
200
+ 3, 36, :_reduce_18,
201
+ 0, 37, :_reduce_19,
202
+ 2, 37, :_reduce_20,
203
+ 2, 33, :_reduce_21,
204
+ 3, 33, :_reduce_22,
205
+ 0, 40, :_reduce_23,
206
+ 1, 40, :_reduce_24,
207
+ 1, 39, :_reduce_25,
208
+ 2, 39, :_reduce_26,
209
+ 1, 41, :_reduce_none,
210
+ 1, 41, :_reduce_none,
211
+ 1, 41, :_reduce_none,
212
+ 4, 42, :_reduce_30,
213
+ 6, 42, :_reduce_31,
214
+ 1, 29, :_reduce_none,
215
+ 1, 29, :_reduce_none,
216
+ 1, 29, :_reduce_none,
217
+ 1, 29, :_reduce_none,
218
+ 1, 29, :_reduce_none,
219
+ 0, 45, :_reduce_37,
220
+ 2, 45, :_reduce_38,
221
+ 3, 45, :_reduce_39,
222
+ 1, 46, :_reduce_40,
223
+ 2, 46, :_reduce_41,
224
+ 3, 47, :_reduce_42,
225
+ 1, 38, :_reduce_43,
226
+ 1, 38, :_reduce_44,
227
+ 1, 38, :_reduce_45,
228
+ 1, 38, :_reduce_46,
229
+ 1, 38, :_reduce_47,
230
+ 1, 38, :_reduce_none,
231
+ 1, 38, :_reduce_none,
232
+ 1, 38, :_reduce_none,
233
+ 1, 38, :_reduce_none,
234
+ 2, 48, :_reduce_52,
235
+ 2, 49, :_reduce_53,
236
+ 3, 49, :_reduce_54,
237
+ 1, 52, :_reduce_55,
238
+ 2, 52, :_reduce_56,
239
+ 2, 50, :_reduce_57,
240
+ 3, 50, :_reduce_58,
241
+ 1, 53, :_reduce_59,
242
+ 2, 53, :_reduce_60,
243
+ 3, 54, :_reduce_61,
244
+ 1, 51, :_reduce_62,
245
+ 0, 32, :_reduce_63,
246
+ 1, 32, :_reduce_none,
247
+ 1, 55, :_reduce_65,
248
+ 2, 55, :_reduce_66,
249
+ 3, 56, :_reduce_67,
250
+ 3, 43, :_reduce_68,
251
+ 5, 44, :_reduce_69,
252
+ 3, 44, :_reduce_70,
253
+ 6, 28, :_reduce_71 ]
254
+
255
+ racc_reduce_n = 72
256
+
257
+ racc_shift_n = 115
258
+
259
+ racc_token_table = {
260
+ false => 0,
261
+ :error => 1,
262
+ :RPAREN => 2,
263
+ :LPAREN => 3,
264
+ :VAR_SIGN => 4,
265
+ :COLON => 5,
266
+ :BANG => 6,
267
+ :RBRACKET => 7,
268
+ :LBRACKET => 8,
269
+ :EQUALS => 9,
270
+ :RCURLY => 10,
271
+ :LCURLY => 11,
272
+ :IDENTIFIER => 12,
273
+ :FRAGMENT => 13,
274
+ :TRUE => 14,
275
+ :FALSE => 15,
276
+ :ON => 16,
277
+ :FLOAT => 17,
278
+ :INT => 18,
279
+ :STRING => 19,
280
+ :DIR_SIGN => 20,
281
+ :ELLIPSIS => 21 }
282
+
283
+ racc_nt_base = 22
284
+
285
+ racc_use_result_var = true
286
+
287
+ Racc_arg = [
288
+ racc_action_table,
289
+ racc_action_check,
290
+ racc_action_default,
291
+ racc_action_pointer,
292
+ racc_goto_table,
293
+ racc_goto_check,
294
+ racc_goto_default,
295
+ racc_goto_pointer,
296
+ racc_nt_base,
297
+ racc_reduce_table,
298
+ racc_token_table,
299
+ racc_shift_n,
300
+ racc_reduce_n,
301
+ racc_use_result_var ]
302
+
303
+ Racc_token_to_s_table = [
304
+ "$end",
305
+ "error",
306
+ "RPAREN",
307
+ "LPAREN",
308
+ "VAR_SIGN",
309
+ "COLON",
310
+ "BANG",
311
+ "RBRACKET",
312
+ "LBRACKET",
313
+ "EQUALS",
314
+ "RCURLY",
315
+ "LCURLY",
316
+ "IDENTIFIER",
317
+ "FRAGMENT",
318
+ "TRUE",
319
+ "FALSE",
320
+ "ON",
321
+ "FLOAT",
322
+ "INT",
323
+ "STRING",
324
+ "DIR_SIGN",
325
+ "ELLIPSIS",
326
+ "$start",
327
+ "target",
328
+ "document",
329
+ "definitions_list",
330
+ "definition",
331
+ "operation_definition",
332
+ "fragment_definition",
333
+ "name",
334
+ "operation_name_opt",
335
+ "variable_definitions_opt",
336
+ "directives_list_opt",
337
+ "selection_set",
338
+ "variable_definitions_list",
339
+ "variable_definition",
340
+ "variable_definition_type_name",
341
+ "variable_definition_default_value_opt",
342
+ "input_value",
343
+ "selection_list",
344
+ "selection_set_opt",
345
+ "selection",
346
+ "field",
347
+ "fragment_spread",
348
+ "inline_fragment",
349
+ "arguments_opt",
350
+ "arguments_list",
351
+ "argument",
352
+ "variable",
353
+ "list_value",
354
+ "object_value",
355
+ "enum_value",
356
+ "list_value_list",
357
+ "object_value_list",
358
+ "object_value_field",
359
+ "directives_list",
360
+ "directive" ]
361
+
362
+ Racc_debug_parser = false
363
+
364
+ ##### State transition tables end #####
365
+
366
+ # reduce 0 omitted
367
+
368
+ # reduce 1 omitted
369
+
370
+ module_eval(<<'.,.,', 'parser.y', 4)
371
+ def _reduce_2(val, _values, result)
372
+ return make_node(:Document, definitions: val[0])
373
+ result
374
+ end
375
+ .,.,
376
+
377
+ module_eval(<<'.,.,', 'parser.y', 7)
378
+ def _reduce_3(val, _values, result)
379
+ return [val[0]]
380
+ result
381
+ end
382
+ .,.,
383
+
384
+ module_eval(<<'.,.,', 'parser.y', 8)
385
+ def _reduce_4(val, _values, result)
386
+ val[0] << val[1]
387
+ result
388
+ end
389
+ .,.,
390
+
391
+ # reduce 5 omitted
392
+
393
+ # reduce 6 omitted
394
+
395
+ module_eval(<<'.,.,', 'parser.y', 16)
396
+ def _reduce_7(val, _values, result)
397
+ return make_node(
398
+ :OperationDefinition, {
399
+ operation_type: val[0],
400
+ name: val[1],
401
+ variables: val[2],
402
+ directives: val[3],
403
+ selections: val[4],
404
+ position_source: val[0],
405
+ }
406
+ )
407
+
408
+ result
409
+ end
410
+ .,.,
411
+
412
+ module_eval(<<'.,.,', 'parser.y', 28)
413
+ def _reduce_8(val, _values, result)
414
+ return make_node(
415
+ :OperationDefinition, {
416
+ operation_type: "query",
417
+ selections: val[0],
418
+ }
419
+ )
420
+
421
+ result
422
+ end
423
+ .,.,
424
+
425
+ module_eval(<<'.,.,', 'parser.y', 37)
426
+ def _reduce_9(val, _values, result)
427
+ return nil
428
+ result
429
+ end
430
+ .,.,
431
+
432
+ # reduce 10 omitted
433
+
434
+ module_eval(<<'.,.,', 'parser.y', 41)
435
+ def _reduce_11(val, _values, result)
436
+ return []
437
+ result
438
+ end
439
+ .,.,
440
+
441
+ module_eval(<<'.,.,', 'parser.y', 42)
442
+ def _reduce_12(val, _values, result)
443
+ return val[1]
444
+ result
445
+ end
446
+ .,.,
447
+
448
+ module_eval(<<'.,.,', 'parser.y', 45)
449
+ def _reduce_13(val, _values, result)
450
+ return [val[0]]
451
+ result
452
+ end
453
+ .,.,
454
+
455
+ module_eval(<<'.,.,', 'parser.y', 46)
456
+ def _reduce_14(val, _values, result)
457
+ val[0] << val[1]
458
+ result
459
+ end
460
+ .,.,
461
+
462
+ module_eval(<<'.,.,', 'parser.y', 50)
463
+ def _reduce_15(val, _values, result)
464
+ return make_node(:VariableDefinition, {
465
+ name: val[1],
466
+ type: val[3],
467
+ default_value: val[4],
468
+ position_source: val[0],
469
+ })
470
+
471
+ result
472
+ end
473
+ .,.,
474
+
475
+ module_eval(<<'.,.,', 'parser.y', 59)
476
+ def _reduce_16(val, _values, result)
477
+ return make_node(:TypeName, name: val[0])
478
+ result
479
+ end
480
+ .,.,
481
+
482
+ module_eval(<<'.,.,', 'parser.y', 60)
483
+ def _reduce_17(val, _values, result)
484
+ return make_node(:NonNullType, of_type: val[0])
485
+ result
486
+ end
487
+ .,.,
488
+
489
+ module_eval(<<'.,.,', 'parser.y', 61)
490
+ def _reduce_18(val, _values, result)
491
+ return make_node(:ListType, of_type: val[1])
492
+ result
493
+ end
494
+ .,.,
495
+
496
+ module_eval(<<'.,.,', 'parser.y', 64)
497
+ def _reduce_19(val, _values, result)
498
+ return nil
499
+ result
500
+ end
501
+ .,.,
502
+
503
+ module_eval(<<'.,.,', 'parser.y', 65)
504
+ def _reduce_20(val, _values, result)
505
+ return val[1]
506
+ result
507
+ end
508
+ .,.,
509
+
510
+ module_eval(<<'.,.,', 'parser.y', 68)
511
+ def _reduce_21(val, _values, result)
512
+ return []
513
+ result
514
+ end
515
+ .,.,
516
+
517
+ module_eval(<<'.,.,', 'parser.y', 69)
518
+ def _reduce_22(val, _values, result)
519
+ return val[1]
520
+ result
521
+ end
522
+ .,.,
523
+
524
+ module_eval(<<'.,.,', 'parser.y', 72)
525
+ def _reduce_23(val, _values, result)
526
+ return []
527
+ result
528
+ end
529
+ .,.,
530
+
531
+ module_eval(<<'.,.,', 'parser.y', 73)
532
+ def _reduce_24(val, _values, result)
533
+ return val[0]
534
+ result
535
+ end
536
+ .,.,
537
+
538
+ module_eval(<<'.,.,', 'parser.y', 76)
539
+ def _reduce_25(val, _values, result)
540
+ return [result]
541
+ result
542
+ end
543
+ .,.,
544
+
545
+ module_eval(<<'.,.,', 'parser.y', 77)
546
+ def _reduce_26(val, _values, result)
547
+ val[0] << val[1]
548
+ result
549
+ end
550
+ .,.,
551
+
552
+ # reduce 27 omitted
553
+
554
+ # reduce 28 omitted
555
+
556
+ # reduce 29 omitted
557
+
558
+ module_eval(<<'.,.,', 'parser.y', 86)
559
+ def _reduce_30(val, _values, result)
560
+ return make_node(
561
+ :Field, {
562
+ name: val[0],
563
+ arguments: val[1],
564
+ directives: val[2],
565
+ selections: val[3],
566
+ position_source: val[0],
567
+ }
568
+ )
569
+
570
+ result
571
+ end
572
+ .,.,
573
+
574
+ module_eval(<<'.,.,', 'parser.y', 97)
575
+ def _reduce_31(val, _values, result)
576
+ return make_node(
577
+ :Field, {
578
+ alias: val[0],
579
+ name: val[2],
580
+ arguments: val[3],
581
+ directives: val[4],
582
+ selections: val[5],
583
+ position_source: val[0],
584
+ }
585
+ )
586
+
587
+ result
588
+ end
589
+ .,.,
590
+
591
+ # reduce 32 omitted
592
+
593
+ # reduce 33 omitted
594
+
595
+ # reduce 34 omitted
596
+
597
+ # reduce 35 omitted
598
+
599
+ # reduce 36 omitted
600
+
601
+ module_eval(<<'.,.,', 'parser.y', 117)
602
+ def _reduce_37(val, _values, result)
603
+ return []
604
+ result
605
+ end
606
+ .,.,
607
+
608
+ module_eval(<<'.,.,', 'parser.y', 118)
609
+ def _reduce_38(val, _values, result)
610
+ return []
611
+ result
612
+ end
613
+ .,.,
614
+
615
+ module_eval(<<'.,.,', 'parser.y', 119)
616
+ def _reduce_39(val, _values, result)
617
+ return val[1]
618
+ result
619
+ end
620
+ .,.,
621
+
622
+ module_eval(<<'.,.,', 'parser.y', 122)
623
+ def _reduce_40(val, _values, result)
624
+ return [val[0]]
625
+ result
626
+ end
627
+ .,.,
628
+
629
+ module_eval(<<'.,.,', 'parser.y', 123)
630
+ def _reduce_41(val, _values, result)
631
+ val[0] << val[1]
632
+ result
633
+ end
634
+ .,.,
635
+
636
+ module_eval(<<'.,.,', 'parser.y', 126)
637
+ def _reduce_42(val, _values, result)
638
+ return make_node(:Argument, name: val[0], value: val[2], position_source: val[0])
639
+ result
640
+ end
641
+ .,.,
642
+
643
+ module_eval(<<'.,.,', 'parser.y', 129)
644
+ def _reduce_43(val, _values, result)
645
+ return val[0].to_f
646
+ result
647
+ end
648
+ .,.,
649
+
650
+ module_eval(<<'.,.,', 'parser.y', 130)
651
+ def _reduce_44(val, _values, result)
652
+ return val[0].to_i
653
+ result
654
+ end
655
+ .,.,
656
+
657
+ module_eval(<<'.,.,', 'parser.y', 131)
658
+ def _reduce_45(val, _values, result)
659
+ return val[0].to_s
660
+ result
661
+ end
662
+ .,.,
663
+
664
+ module_eval(<<'.,.,', 'parser.y', 132)
665
+ def _reduce_46(val, _values, result)
666
+ return true
667
+ result
668
+ end
669
+ .,.,
670
+
671
+ module_eval(<<'.,.,', 'parser.y', 133)
672
+ def _reduce_47(val, _values, result)
673
+ return false
674
+ result
675
+ end
676
+ .,.,
677
+
678
+ # reduce 48 omitted
679
+
680
+ # reduce 49 omitted
681
+
682
+ # reduce 50 omitted
683
+
684
+ # reduce 51 omitted
685
+
686
+ module_eval(<<'.,.,', 'parser.y', 139)
687
+ def _reduce_52(val, _values, result)
688
+ return make_node(:VariableIdentifier, name: val[1], position_source: val[0])
689
+ result
690
+ end
691
+ .,.,
692
+
693
+ module_eval(<<'.,.,', 'parser.y', 142)
694
+ def _reduce_53(val, _values, result)
695
+ return []
696
+ result
697
+ end
698
+ .,.,
699
+
700
+ module_eval(<<'.,.,', 'parser.y', 143)
701
+ def _reduce_54(val, _values, result)
702
+ return val[1]
703
+ result
704
+ end
705
+ .,.,
706
+
707
+ module_eval(<<'.,.,', 'parser.y', 146)
708
+ def _reduce_55(val, _values, result)
709
+ return [val[0]]
710
+ result
711
+ end
712
+ .,.,
713
+
714
+ module_eval(<<'.,.,', 'parser.y', 147)
715
+ def _reduce_56(val, _values, result)
716
+ val[0] << val[1]
717
+ result
718
+ end
719
+ .,.,
720
+
721
+ module_eval(<<'.,.,', 'parser.y', 150)
722
+ def _reduce_57(val, _values, result)
723
+ return make_node(:InputObject, arguments: [], position_source: val[0])
724
+ result
725
+ end
726
+ .,.,
727
+
728
+ module_eval(<<'.,.,', 'parser.y', 151)
729
+ def _reduce_58(val, _values, result)
730
+ return make_node(:InputObject, arguments: val[1], position_source: val[0])
731
+ result
732
+ end
733
+ .,.,
734
+
735
+ module_eval(<<'.,.,', 'parser.y', 154)
736
+ def _reduce_59(val, _values, result)
737
+ return [val[0]]
738
+ result
739
+ end
740
+ .,.,
741
+
742
+ module_eval(<<'.,.,', 'parser.y', 155)
743
+ def _reduce_60(val, _values, result)
744
+ val[0] << val[1]
745
+ result
746
+ end
747
+ .,.,
748
+
749
+ module_eval(<<'.,.,', 'parser.y', 158)
750
+ def _reduce_61(val, _values, result)
751
+ return make_node(:Argument, name: val[0], value: val[2], position_source: val[0])
752
+ result
753
+ end
754
+ .,.,
755
+
756
+ module_eval(<<'.,.,', 'parser.y', 160)
757
+ def _reduce_62(val, _values, result)
758
+ return make_node(:Enum, name: val[0], position_source: val[0])
759
+ result
760
+ end
761
+ .,.,
762
+
763
+ module_eval(<<'.,.,', 'parser.y', 163)
764
+ def _reduce_63(val, _values, result)
765
+ return []
766
+ result
767
+ end
768
+ .,.,
769
+
770
+ # reduce 64 omitted
771
+
772
+ module_eval(<<'.,.,', 'parser.y', 167)
773
+ def _reduce_65(val, _values, result)
774
+ return [val[0]]
775
+ result
776
+ end
777
+ .,.,
778
+
779
+ module_eval(<<'.,.,', 'parser.y', 168)
780
+ def _reduce_66(val, _values, result)
781
+ val[0] << val[1]
782
+ result
783
+ end
784
+ .,.,
785
+
786
+ module_eval(<<'.,.,', 'parser.y', 170)
787
+ def _reduce_67(val, _values, result)
788
+ return make_node(:Directive, name: val[1], arguments: val[2], position_source: val[0])
789
+ result
790
+ end
791
+ .,.,
792
+
793
+ module_eval(<<'.,.,', 'parser.y', 173)
794
+ def _reduce_68(val, _values, result)
795
+ return make_node(:FragmentSpread, name: val[1], directives: val[2], position_source: val[0])
796
+ result
797
+ end
798
+ .,.,
799
+
800
+ module_eval(<<'.,.,', 'parser.y', 177)
801
+ def _reduce_69(val, _values, result)
802
+ return make_node(:InlineFragment, {
803
+ type: val[2],
804
+ directives: val[3],
805
+ selections: val[4],
806
+ position_source: val[0]
807
+ })
808
+
809
+ result
810
+ end
811
+ .,.,
812
+
813
+ module_eval(<<'.,.,', 'parser.y', 185)
814
+ def _reduce_70(val, _values, result)
815
+ return make_node(:InlineFragment, {
816
+ type: nil,
817
+ directives: val[1],
818
+ selections: val[2],
819
+ position_source: val[0]
820
+ })
821
+
822
+ result
823
+ end
824
+ .,.,
825
+
826
+ module_eval(<<'.,.,', 'parser.y', 195)
827
+ def _reduce_71(val, _values, result)
828
+ return make_node(:FragmentDefinition, {
829
+ name: val[1],
830
+ type: val[3],
831
+ directives: val[4],
832
+ selections: val[5],
833
+ position_source: val[0],
834
+ }
835
+ )
836
+
837
+ result
838
+ end
839
+ .,.,
840
+
841
+ def _reduce_none(val, _values, result)
842
+ val[0]
121
843
  end
844
+
845
+ end # class Parser
846
+ end # module Language
847
+ end # module GraphQL