graphql 1.9.4 → 1.9.5
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.
- checksums.yaml +5 -5
- data/lib/graphql/execution/execute.rb +3 -0
- data/lib/graphql/execution/interpreter/runtime.rb +2 -2
- data/lib/graphql/execution/lookahead.rb +57 -22
- data/lib/graphql/introspection/input_value_type.rb +5 -1
- data/lib/graphql/language/parser.rb +57 -54
- data/lib/graphql/language/parser.y +12 -9
- data/lib/graphql/language/token.rb +1 -1
- data/lib/graphql/language/visitor.rb +1 -1
- data/lib/graphql/query/arguments.rb +3 -3
- data/lib/graphql/query/context.rb +6 -6
- data/lib/graphql/query/variable_validation_error.rb +14 -0
- data/lib/graphql/schema.rb +2 -2
- data/lib/graphql/schema/argument.rb +1 -1
- data/lib/graphql/schema/field.rb +6 -3
- data/lib/graphql/schema/object.rb +2 -2
- data/lib/graphql/schema/relay_classic_mutation.rb +1 -1
- data/lib/graphql/schema/rescue_middleware.rb +7 -2
- data/lib/graphql/schema/validation.rb +9 -4
- data/lib/graphql/static_validation/base_visitor.rb +8 -5
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +3 -1
- data/lib/graphql/tracing.rb +3 -3
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/types/json.rb +25 -0
- data/lib/graphql/types/relay/base_edge.rb +3 -2
- data/lib/graphql/unauthorized_field_error.rb +1 -1
- data/lib/graphql/version.rb +1 -1
- data/spec/dummy/Gemfile.lock +157 -0
- data/spec/dummy/log/test.log +199 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4w/4wzXRZrAkwKdgYaSE0pid5eB-fer8vSfSku_NPg4rMA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7I/7IHVBiJT06QSpgLpLoJIxboQ0B-D_tMTxsvoezBTV3Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8w/8wY_SKagj8wHuwGNAAf6JnQ8joMbC6cEYpHrTAI8Urc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AK/AKzz1u6bGb4auXcrObA_g5LL-oV0ejNGa448AgAi_WQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ET/ETW4uxvaYpruL8y6_ZptUH82ZowMaHIqvg5WexBFdEM.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F1/F1TWpjjyA56k9Z90n5B3xRn7DUdGjX73QCkYC6k07JQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F8/F8MUNRzORGFgr329fNM0xLaoWCXdv3BIalT7dsvLfjs.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/KB/KB07ZaKNC5uXJ7TjLi-WqnY6g7dq8wWp_8N3HNjBNxg.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ms/MsKSimH_UCB-H1tLvDABDHuvGciuoW6kVqQWDrXU5FQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Mt/Mtci-Kim50aPOmeClD4AIicKn1d1WJ0n454IjSd94sk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/QH/QHt3Tc1Y6M66Oo_pDuMyWrQNs4Pp3SMeZR5K1wJj2Ts.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XU/XU4k1OXnfMils5SrirorPvDSyDSqiOWLZNtmAH1HH8k.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZI/ZIof7mZxWWCnraIFOCuV6a8QRWzKJXJnx2Xd7C0ZyX0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cG/cGc_puuPS5pZKgUcy1Y_i1L6jl5UtsiIrMH59rTzR6c.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/df/dfro_B6bx3KP1Go-7jEOqqZ2j4hVRseXIc3es9PKQno.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jO/jO1DfbqnG0mTULsjJJANc3fefrG2zt7DIMmcptMT628.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pE/pE7gO6pQ-z187Swb4hT554wmqsq-cNzgPWLrCz-LQQQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r9/r9iU1l58a6rxkZSW5RSC52_tD-_UQuHxoMVnkfJ7Mhs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xi/xitPPFfPIyDMpaznV0sBBcw8eSCV8PJcLLWin78sCgE.cache +0 -0
- data/spec/dummy/tmp/screenshots/failures_test_it_handles_subscriptions.png +0 -0
- data/spec/graphql/authorization_spec.rb +47 -14
- data/spec/graphql/execution/lookahead_spec.rb +29 -2
- data/spec/graphql/function_spec.rb +28 -5
- data/spec/graphql/introspection/input_value_type_spec.rb +40 -1
- data/spec/graphql/language/parser_spec.rb +8 -0
- data/spec/graphql/query/executor_spec.rb +30 -3
- data/spec/graphql/schema/object_spec.rb +71 -0
- data/spec/graphql/schema/relay_classic_mutation_spec.rb +18 -0
- data/spec/graphql/schema/rescue_middleware_spec.rb +14 -0
- data/spec/graphql/schema/warden_spec.rb +1 -1
- data/spec/graphql/types/relay/base_edge_spec.rb +33 -0
- data/spec/integration/rails/graphql/schema_spec.rb +13 -0
- data/spec/integration/tmp/app/graphql/types/bird_type.rb +7 -0
- data/spec/support/dummy/schema.rb +19 -0
- data/spec/support/jazz.rb +16 -14
- metadata +57 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e40125b3e84f5cd17820a8268ad2874ae7c980dc
|
|
4
|
+
data.tar.gz: bd888bd788b3da91473d5dbaa8a298cf89770cf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a9113377e811baf0011f17fbef343eafe2151d61d9ad3a26c0d6a422590e0e3e19ed0545531ec3f3ea84653534a21e66a34d006214218c52128a557bfb06b75
|
|
7
|
+
data.tar.gz: cee421d5d91cd63b880ba88324a840125bc20cf6e6976b85f52cdcd2bfea1c703a58c7fda50ece82aa77c0b1943fc4fa2514bba995e4a78bb4e4d6dc877c158d
|
|
@@ -128,6 +128,9 @@ module GraphQL
|
|
|
128
128
|
field_ctx.trace("execute_field", { context: field_ctx }) do
|
|
129
129
|
field_ctx.schema.middleware.invoke([parent_type, object, field, arguments, field_ctx])
|
|
130
130
|
end
|
|
131
|
+
rescue GraphQL::UnauthorizedFieldError => err
|
|
132
|
+
err.field ||= field
|
|
133
|
+
field_ctx.schema.unauthorized_field(err)
|
|
131
134
|
rescue GraphQL::UnauthorizedError => err
|
|
132
135
|
field_ctx.schema.unauthorized_object(err)
|
|
133
136
|
end
|
|
@@ -205,7 +205,7 @@ module GraphQL
|
|
|
205
205
|
|
|
206
206
|
field_result = resolve_with_directives(object, ast_node) do
|
|
207
207
|
# Actually call the field resolver and capture the result
|
|
208
|
-
app_result = query.trace("execute_field", {owner: owner_type, field: field_defn, path: next_path}) do
|
|
208
|
+
app_result = query.trace("execute_field", {owner: owner_type, field: field_defn, path: next_path, query: query}) do
|
|
209
209
|
field_defn.resolve(object, kwarg_arguments, context)
|
|
210
210
|
end
|
|
211
211
|
after_lazy(app_result, owner: owner_type, field: field_defn, path: next_path) do |inner_result|
|
|
@@ -398,7 +398,7 @@ module GraphQL
|
|
|
398
398
|
@interpreter_context[:current_field] = field
|
|
399
399
|
# Wrap the execution of _this_ method with tracing,
|
|
400
400
|
# but don't wrap the continuation below
|
|
401
|
-
inner_obj = query.trace("execute_field_lazy", {owner: owner, field: field, path: path}) do
|
|
401
|
+
inner_obj = query.trace("execute_field_lazy", {owner: owner, field: field, path: path, query: query}) do
|
|
402
402
|
begin
|
|
403
403
|
schema.sync_lazy(obj)
|
|
404
404
|
rescue GraphQL::ExecutionError, GraphQL::UnauthorizedError => err
|
|
@@ -31,12 +31,13 @@ module GraphQL
|
|
|
31
31
|
# @param ast_nodes [Array<GraphQL::Language::Nodes::Field>, Array<GraphQL::Language::Nodes::OperationDefinition>]
|
|
32
32
|
# @param field [GraphQL::Schema::Field] if `ast_nodes` are fields, this is the field definition matching those nodes
|
|
33
33
|
# @param root_type [Class] if `ast_nodes` are operation definition, this is the root type for that operation
|
|
34
|
-
def initialize(query:, ast_nodes:, field: nil, root_type: nil)
|
|
34
|
+
def initialize(query:, ast_nodes:, field: nil, root_type: nil, owner_type: nil)
|
|
35
35
|
@ast_nodes = ast_nodes.freeze
|
|
36
36
|
@field = field
|
|
37
37
|
@root_type = root_type
|
|
38
38
|
@query = query
|
|
39
39
|
@selected_type = @field ? @field.type.unwrap : root_type
|
|
40
|
+
@owner_type = owner_type
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
# @return [Array<GraphQL::Language::Nodes::Field>]
|
|
@@ -45,6 +46,14 @@ module GraphQL
|
|
|
45
46
|
# @return [GraphQL::Schema::Field]
|
|
46
47
|
attr_reader :field
|
|
47
48
|
|
|
49
|
+
# @return [GraphQL::Schema::Object, GraphQL::Schema::Union, GraphQL::Schema::Interface]
|
|
50
|
+
attr_reader :owner_type
|
|
51
|
+
|
|
52
|
+
# @return [Hash<Symbol, Object>]
|
|
53
|
+
def arguments
|
|
54
|
+
@arguments ||= @field && ArgumentHelpers.arguments(@query, nil, @field, ast_nodes.first)
|
|
55
|
+
end
|
|
56
|
+
|
|
48
57
|
# True if this node has a selection on `field_name`.
|
|
49
58
|
# If `field_name` is a String, it is treated as a GraphQL-style (camelized)
|
|
50
59
|
# field name and used verbatim. If `field_name` is a Symbol, it is
|
|
@@ -82,7 +91,7 @@ module GraphQL
|
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
if next_nodes.any?
|
|
85
|
-
Lookahead.new(query: @query, ast_nodes: next_nodes, field: next_field_defn)
|
|
94
|
+
Lookahead.new(query: @query, ast_nodes: next_nodes, field: next_field_defn, owner_type: selected_type)
|
|
86
95
|
else
|
|
87
96
|
NULL_LOOKAHEAD
|
|
88
97
|
end
|
|
@@ -107,13 +116,24 @@ module GraphQL
|
|
|
107
116
|
# @param arguments [Hash] Arguments which must match in the selection
|
|
108
117
|
# @return [Array<GraphQL::Execution::Lookahead>]
|
|
109
118
|
def selections(arguments: nil)
|
|
110
|
-
|
|
119
|
+
subselections_by_type = {}
|
|
120
|
+
subselections_on_type = subselections_by_type[@selected_type] = {}
|
|
121
|
+
|
|
111
122
|
@ast_nodes.each do |node|
|
|
112
|
-
find_selections(
|
|
123
|
+
find_selections(subselections_by_type, subselections_on_type, @selected_type, node.selections, arguments)
|
|
113
124
|
end
|
|
114
125
|
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
subselections = []
|
|
127
|
+
|
|
128
|
+
subselections_by_type.each do |type, ast_nodes_by_response_key|
|
|
129
|
+
ast_nodes_by_response_key.each do |response_key, ast_nodes|
|
|
130
|
+
field_defn = FieldHelpers.get_field(@query.schema, type, ast_nodes.first.name)
|
|
131
|
+
lookahead = Lookahead.new(query: @query, ast_nodes: ast_nodes, field: field_defn, owner_type: type)
|
|
132
|
+
subselections.push(lookahead)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
subselections
|
|
117
137
|
end
|
|
118
138
|
|
|
119
139
|
# The method name of the field.
|
|
@@ -183,22 +203,36 @@ module GraphQL
|
|
|
183
203
|
end
|
|
184
204
|
end
|
|
185
205
|
|
|
186
|
-
def find_selections(
|
|
206
|
+
def find_selections(subselections_by_type, selections_on_type, selected_type, ast_selections, arguments)
|
|
187
207
|
ast_selections.each do |ast_selection|
|
|
188
208
|
case ast_selection
|
|
189
209
|
when GraphQL::Language::Nodes::Field
|
|
190
|
-
|
|
210
|
+
response_key = ast_selection.alias || ast_selection.name
|
|
211
|
+
if selections_on_type.key?(response_key)
|
|
212
|
+
selections_on_type[response_key] << ast_selection
|
|
213
|
+
elsif arguments.nil? || arguments.empty?
|
|
214
|
+
selections_on_type[response_key] = [ast_selection]
|
|
215
|
+
else
|
|
216
|
+
field_defn = FieldHelpers.get_field(@query.schema, selected_type, ast_selection.name)
|
|
217
|
+
if arguments_match?(arguments, field_defn, ast_selection)
|
|
218
|
+
selections_on_type[response_key] = [ast_selection]
|
|
219
|
+
end
|
|
220
|
+
end
|
|
191
221
|
when GraphQL::Language::Nodes::InlineFragment
|
|
222
|
+
on_type = selected_type
|
|
223
|
+
subselections_on_type = selections_on_type
|
|
192
224
|
if (t = ast_selection.type)
|
|
193
225
|
# Assuming this is valid, that `t` will be found.
|
|
194
|
-
|
|
226
|
+
on_type = @query.schema.types[t.name].metadata[:type_class]
|
|
227
|
+
subselections_on_type = subselections_by_type[on_type] ||= {}
|
|
195
228
|
end
|
|
196
|
-
find_selections(
|
|
229
|
+
find_selections(subselections_by_type, subselections_on_type, on_type, ast_selection.selections, arguments)
|
|
197
230
|
when GraphQL::Language::Nodes::FragmentSpread
|
|
198
231
|
frag_defn = @query.fragments[ast_selection.name] || raise("Invariant: Can't look ahead to nonexistent fragment #{ast_selection.name} (found: #{@query.fragments.keys})")
|
|
199
232
|
# Again, assuming a valid AST
|
|
200
|
-
|
|
201
|
-
|
|
233
|
+
on_type = @query.schema.types[frag_defn.type.name].metadata[:type_class]
|
|
234
|
+
subselections_on_type = subselections_by_type[on_type] ||= {}
|
|
235
|
+
find_selections(subselections_by_type, subselections_on_type, on_type, frag_defn.selections, arguments)
|
|
202
236
|
else
|
|
203
237
|
raise "Invariant: Unexpected selection type: #{ast_selection.class}"
|
|
204
238
|
end
|
|
@@ -214,16 +248,8 @@ module GraphQL
|
|
|
214
248
|
if arguments.nil? || arguments.empty?
|
|
215
249
|
# No constraint applied
|
|
216
250
|
matches << node
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
passes_args = arguments.all? do |arg_name, arg_value|
|
|
220
|
-
arg_name = normalize_keyword(arg_name)
|
|
221
|
-
# Make sure the constraint is present with a matching value
|
|
222
|
-
query_kwargs.key?(arg_name) && query_kwargs[arg_name] == arg_value
|
|
223
|
-
end
|
|
224
|
-
if passes_args
|
|
225
|
-
matches << node
|
|
226
|
-
end
|
|
251
|
+
elsif arguments_match?(arguments, field_defn, node)
|
|
252
|
+
matches << node
|
|
227
253
|
end
|
|
228
254
|
end
|
|
229
255
|
when GraphQL::Language::Nodes::InlineFragment
|
|
@@ -236,6 +262,15 @@ module GraphQL
|
|
|
236
262
|
end
|
|
237
263
|
end
|
|
238
264
|
|
|
265
|
+
def arguments_match?(arguments, field_defn, field_node)
|
|
266
|
+
query_kwargs = ArgumentHelpers.arguments(@query, nil, field_defn, field_node)
|
|
267
|
+
arguments.all? do |arg_name, arg_value|
|
|
268
|
+
arg_name = normalize_keyword(arg_name)
|
|
269
|
+
# Make sure the constraint is present with a matching value
|
|
270
|
+
query_kwargs.key?(arg_name) && query_kwargs[arg_name] == arg_value
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
239
274
|
# TODO Dedup with interpreter
|
|
240
275
|
module ArgumentHelpers
|
|
241
276
|
module_function
|
|
@@ -19,7 +19,11 @@ module GraphQL
|
|
|
19
19
|
else
|
|
20
20
|
coerced_default_value = @object.type.coerce_result(value, @context)
|
|
21
21
|
if @object.type.unwrap.is_a?(GraphQL::EnumType)
|
|
22
|
-
|
|
22
|
+
if @object.type.list?
|
|
23
|
+
"[#{coerced_default_value.join(", ")}]"
|
|
24
|
+
else
|
|
25
|
+
coerced_default_value
|
|
26
|
+
end
|
|
23
27
|
else
|
|
24
28
|
GraphQL::Language.serialize(coerced_default_value)
|
|
25
29
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# DO NOT MODIFY!!!!
|
|
3
|
-
# This file is automatically generated by Racc 1.4.
|
|
3
|
+
# This file is automatically generated by Racc 1.4.15
|
|
4
4
|
# from Racc grammer file "".
|
|
5
5
|
#
|
|
6
6
|
|
|
@@ -14,7 +14,10 @@ module GraphQL
|
|
|
14
14
|
|
|
15
15
|
module_eval(<<'...end parser.y/module_eval...', 'parser.y', 435)
|
|
16
16
|
|
|
17
|
+
EMPTY_ARRAY = [].freeze
|
|
18
|
+
|
|
17
19
|
def initialize(query_string, filename:, tracer: Tracing::NullTracer)
|
|
20
|
+
raise GraphQL::ParseError.new("No query string was present", nil, nil, query_string) if query_string.nil?
|
|
18
21
|
@query_string = query_string
|
|
19
22
|
@filename = filename
|
|
20
23
|
@tracer = tracer
|
|
@@ -476,24 +479,24 @@ racc_action_default = [
|
|
|
476
479
|
-93, -97, -99, -99, -165, -160 ]
|
|
477
480
|
|
|
478
481
|
racc_goto_table = [
|
|
479
|
-
10, 72, 59, 10, 91, 195, 129,
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
171,
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
117,
|
|
487
|
-
|
|
488
|
-
148, 150, 151,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
nil, nil, 172, 180,
|
|
492
|
-
nil, 202,
|
|
493
|
-
nil, nil,
|
|
494
|
-
202, nil, nil, 202, nil, nil, nil, nil, nil,
|
|
495
|
-
nil, nil, nil,
|
|
496
|
-
nil, nil, nil,
|
|
482
|
+
10, 72, 59, 10, 91, 195, 129, 132, 133, 283,
|
|
483
|
+
164, 203, 68, 125, 175, 202, 102, 135, 92, 37,
|
|
484
|
+
259, 227, 37, 4, 301, 182, 39, 159, 235, 99,
|
|
485
|
+
304, 119, 271, 245, 274, 270, 118, 2, 140, 271,
|
|
486
|
+
171, 274, 274, 167, 153, 88, 311, 139, 97, 143,
|
|
487
|
+
145, 147, 149, 134, 177, 103, 175, 281, 1, 288,
|
|
488
|
+
161, 256, 99, 95, 231, 202, 313, 40, 183, 3,
|
|
489
|
+
117, 258, 141, 266, 121, 165, 241, 127, 152, 292,
|
|
490
|
+
221, 248, 249, 224, 179, 202, 252, 276, 144, 146,
|
|
491
|
+
148, 150, 151, 255, 154, 155, 156, 157, 286, 99,
|
|
492
|
+
124, 137, 202, 99, 67, 99, 251, 99, 236, 99,
|
|
493
|
+
264, 170, 294, 246, 240, 173, nil, 91, 264, 247,
|
|
494
|
+
nil, nil, 172, 180, nil, nil, 41, 65, 264, nil,
|
|
495
|
+
nil, 202, nil, nil, 189, 137, nil, 202, 137, 99,
|
|
496
|
+
nil, nil, nil, nil, nil, nil, nil, 197, nil, 264,
|
|
497
|
+
202, nil, nil, 202, nil, nil, nil, nil, nil, 264,
|
|
498
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 201, nil,
|
|
499
|
+
nil, nil, nil, nil, nil, 65, nil, 137, nil, nil,
|
|
497
500
|
nil, nil, nil, nil, nil, nil, nil, 100, nil, nil,
|
|
498
501
|
104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
|
|
499
502
|
114, 115, nil, nil, nil, nil, 238, 242, 308, 122,
|
|
@@ -520,24 +523,24 @@ racc_goto_table = [
|
|
|
520
523
|
nil, nil, nil, nil, nil, nil, 309, nil, 293 ]
|
|
521
524
|
|
|
522
525
|
racc_goto_check = [
|
|
523
|
-
10, 13, 15, 10, 23, 79, 19,
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
19,
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
13,
|
|
531
|
-
|
|
532
|
-
13, 13, 13,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
nil, nil, 15, 13,
|
|
536
|
-
nil, 29,
|
|
537
|
-
nil, nil,
|
|
538
|
-
29, nil, nil, 29, nil, nil, nil, nil, nil,
|
|
539
|
-
nil, nil, nil,
|
|
540
|
-
nil, nil, nil,
|
|
526
|
+
10, 13, 15, 10, 23, 79, 19, 14, 19, 20,
|
|
527
|
+
22, 36, 28, 35, 55, 29, 48, 54, 27, 32,
|
|
528
|
+
45, 71, 32, 4, 21, 76, 4, 14, 71, 49,
|
|
529
|
+
21, 18, 31, 71, 78, 30, 17, 2, 70, 31,
|
|
530
|
+
19, 78, 78, 35, 70, 12, 21, 48, 13, 48,
|
|
531
|
+
48, 48, 48, 27, 54, 13, 55, 81, 1, 45,
|
|
532
|
+
18, 36, 49, 28, 76, 29, 20, 11, 77, 3,
|
|
533
|
+
13, 44, 72, 71, 13, 27, 74, 13, 72, 47,
|
|
534
|
+
14, 74, 74, 14, 48, 29, 22, 71, 13, 13,
|
|
535
|
+
13, 13, 13, 43, 13, 13, 13, 13, 36, 49,
|
|
536
|
+
34, 10, 29, 49, 50, 49, 19, 49, 73, 49,
|
|
537
|
+
80, 13, 79, 73, 33, 13, nil, 23, 80, 33,
|
|
538
|
+
nil, nil, 15, 13, nil, nil, 16, 16, 80, nil,
|
|
539
|
+
nil, 29, nil, nil, 13, 10, nil, 29, 10, 49,
|
|
540
|
+
nil, nil, nil, nil, nil, nil, nil, 13, nil, 80,
|
|
541
|
+
29, nil, nil, 29, nil, nil, nil, nil, nil, 80,
|
|
542
|
+
nil, nil, nil, nil, nil, nil, nil, nil, 10, nil,
|
|
543
|
+
nil, nil, nil, nil, nil, 16, nil, 10, nil, nil,
|
|
541
544
|
nil, nil, nil, nil, nil, nil, nil, 16, nil, nil,
|
|
542
545
|
16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
543
546
|
16, 16, nil, nil, nil, nil, 32, 32, 19, 16,
|
|
@@ -564,15 +567,15 @@ racc_goto_check = [
|
|
|
564
567
|
nil, nil, nil, nil, nil, nil, 16, nil, 16 ]
|
|
565
568
|
|
|
566
569
|
racc_goto_pointer = [
|
|
567
|
-
nil,
|
|
568
|
-
0,
|
|
569
|
-
-
|
|
570
|
-
-
|
|
571
|
-
nil, nil, nil, -
|
|
572
|
-
|
|
570
|
+
nil, 58, 37, 69, 23, nil, nil, nil, nil, nil,
|
|
571
|
+
0, 57, 5, -18, -90, -9, 116, -53, -58, -90,
|
|
572
|
+
-242, -260, -111, -55, nil, nil, nil, -47, -3, -153,
|
|
573
|
+
-203, -208, 19, -73, 6, -81, -157, nil, nil, nil,
|
|
574
|
+
nil, nil, nil, -125, -148, -199, nil, -182, -57, -40,
|
|
575
|
+
89, nil, nil, nil, -84, -121, nil, nil, nil, nil,
|
|
573
576
|
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
|
|
574
|
-
-
|
|
575
|
-
-
|
|
577
|
+
-67, -157, -33, -78, -112, nil, -117, -74, -207, -153,
|
|
578
|
+
-117, -193 ]
|
|
576
579
|
|
|
577
580
|
racc_goto_default = [
|
|
578
581
|
nil, nil, nil, nil, nil, 5, 6, 7, 8, 9,
|
|
@@ -1052,7 +1055,7 @@ module_eval(<<'.,.,', 'parser.y', 57)
|
|
|
1052
1055
|
|
|
1053
1056
|
module_eval(<<'.,.,', 'parser.y', 61)
|
|
1054
1057
|
def _reduce_18(val, _values, result)
|
|
1055
|
-
return
|
|
1058
|
+
return EMPTY_ARRAY
|
|
1056
1059
|
result
|
|
1057
1060
|
end
|
|
1058
1061
|
.,.,
|
|
@@ -1135,7 +1138,7 @@ module_eval(<<'.,.,', 'parser.y', 88)
|
|
|
1135
1138
|
|
|
1136
1139
|
module_eval(<<'.,.,', 'parser.y', 91)
|
|
1137
1140
|
def _reduce_29(val, _values, result)
|
|
1138
|
-
return
|
|
1141
|
+
return EMPTY_ARRAY
|
|
1139
1142
|
result
|
|
1140
1143
|
end
|
|
1141
1144
|
.,.,
|
|
@@ -1267,14 +1270,14 @@ module_eval(<<'.,.,', 'parser.y', 163)
|
|
|
1267
1270
|
|
|
1268
1271
|
module_eval(<<'.,.,', 'parser.y', 166)
|
|
1269
1272
|
def _reduce_63(val, _values, result)
|
|
1270
|
-
return
|
|
1273
|
+
return EMPTY_ARRAY
|
|
1271
1274
|
result
|
|
1272
1275
|
end
|
|
1273
1276
|
.,.,
|
|
1274
1277
|
|
|
1275
1278
|
module_eval(<<'.,.,', 'parser.y', 167)
|
|
1276
1279
|
def _reduce_64(val, _values, result)
|
|
1277
|
-
return
|
|
1280
|
+
return EMPTY_ARRAY
|
|
1278
1281
|
result
|
|
1279
1282
|
end
|
|
1280
1283
|
.,.,
|
|
@@ -1374,7 +1377,7 @@ module_eval(<<'.,.,', 'parser.y', 194)
|
|
|
1374
1377
|
|
|
1375
1378
|
module_eval(<<'.,.,', 'parser.y', 197)
|
|
1376
1379
|
def _reduce_84(val, _values, result)
|
|
1377
|
-
return
|
|
1380
|
+
return EMPTY_ARRAY
|
|
1378
1381
|
result
|
|
1379
1382
|
end
|
|
1380
1383
|
.,.,
|
|
@@ -1479,7 +1482,7 @@ module_eval(<<'.,.,', 'parser.y', 227)
|
|
|
1479
1482
|
|
|
1480
1483
|
module_eval(<<'.,.,', 'parser.y', 230)
|
|
1481
1484
|
def _reduce_99(val, _values, result)
|
|
1482
|
-
return
|
|
1485
|
+
return EMPTY_ARRAY
|
|
1483
1486
|
result
|
|
1484
1487
|
end
|
|
1485
1488
|
.,.,
|
|
@@ -1750,7 +1753,7 @@ module_eval(<<'.,.,', 'parser.y', 353)
|
|
|
1750
1753
|
|
|
1751
1754
|
module_eval(<<'.,.,', 'parser.y', 357)
|
|
1752
1755
|
def _reduce_151(val, _values, result)
|
|
1753
|
-
return
|
|
1756
|
+
return EMPTY_ARRAY
|
|
1754
1757
|
result
|
|
1755
1758
|
end
|
|
1756
1759
|
.,.,
|
|
@@ -1830,7 +1833,7 @@ module_eval(<<'.,.,', 'parser.y', 380)
|
|
|
1830
1833
|
|
|
1831
1834
|
module_eval(<<'.,.,', 'parser.y', 383)
|
|
1832
1835
|
def _reduce_163(val, _values, result)
|
|
1833
|
-
return
|
|
1836
|
+
return EMPTY_ARRAY
|
|
1834
1837
|
result
|
|
1835
1838
|
end
|
|
1836
1839
|
.,.,
|
|
@@ -1852,7 +1855,7 @@ module_eval(<<'.,.,', 'parser.y', 388)
|
|
|
1852
1855
|
|
|
1853
1856
|
module_eval(<<'.,.,', 'parser.y', 392)
|
|
1854
1857
|
def _reduce_166(val, _values, result)
|
|
1855
|
-
return
|
|
1858
|
+
return EMPTY_ARRAY
|
|
1856
1859
|
result
|
|
1857
1860
|
end
|
|
1858
1861
|
.,.,
|
|
@@ -59,7 +59,7 @@ rule
|
|
|
59
59
|
| name
|
|
60
60
|
|
|
61
61
|
variable_definitions_opt:
|
|
62
|
-
/* none */ { return
|
|
62
|
+
/* none */ { return EMPTY_ARRAY }
|
|
63
63
|
| LPAREN variable_definitions_list RPAREN { return val[1] }
|
|
64
64
|
|
|
65
65
|
variable_definitions_list:
|
|
@@ -89,7 +89,7 @@ rule
|
|
|
89
89
|
LCURLY selection_list RCURLY { return val[1] }
|
|
90
90
|
|
|
91
91
|
selection_set_opt:
|
|
92
|
-
/* none */ { return
|
|
92
|
+
/* none */ { return EMPTY_ARRAY }
|
|
93
93
|
| selection_set { return val[0] }
|
|
94
94
|
|
|
95
95
|
selection_list:
|
|
@@ -164,8 +164,8 @@ rule
|
|
|
164
164
|
| enum_value_definitions enum_value_definition { return val[0] << val[1] }
|
|
165
165
|
|
|
166
166
|
arguments_opt:
|
|
167
|
-
/* none */ { return
|
|
168
|
-
| LPAREN RPAREN { return
|
|
167
|
+
/* none */ { return EMPTY_ARRAY }
|
|
168
|
+
| LPAREN RPAREN { return EMPTY_ARRAY }
|
|
169
169
|
| LPAREN arguments_list RPAREN { return val[1] }
|
|
170
170
|
|
|
171
171
|
arguments_list:
|
|
@@ -195,7 +195,7 @@ rule
|
|
|
195
195
|
variable: VAR_SIGN name { return make_node(:VariableIdentifier, name: val[1], position_source: val[0]) }
|
|
196
196
|
|
|
197
197
|
list_value:
|
|
198
|
-
LBRACKET RBRACKET { return
|
|
198
|
+
LBRACKET RBRACKET { return EMPTY_ARRAY }
|
|
199
199
|
| LBRACKET list_value_list RBRACKET { return val[1] }
|
|
200
200
|
|
|
201
201
|
list_value_list:
|
|
@@ -228,7 +228,7 @@ rule
|
|
|
228
228
|
enum_value: enum_name { return make_node(:Enum, name: val[0], position_source: val[0]) }
|
|
229
229
|
|
|
230
230
|
directives_list_opt:
|
|
231
|
-
/* none */ { return
|
|
231
|
+
/* none */ { return EMPTY_ARRAY }
|
|
232
232
|
| directives_list
|
|
233
233
|
|
|
234
234
|
directives_list:
|
|
@@ -355,7 +355,7 @@ rule
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
implements_opt:
|
|
358
|
-
/* none */ { return
|
|
358
|
+
/* none */ { return EMPTY_ARRAY }
|
|
359
359
|
| implements
|
|
360
360
|
|
|
361
361
|
implements:
|
|
@@ -381,7 +381,7 @@ rule
|
|
|
381
381
|
| input_value_definition_list input_value_definition { val[0] << val[1] }
|
|
382
382
|
|
|
383
383
|
arguments_definitions_opt:
|
|
384
|
-
/* none */ { return
|
|
384
|
+
/* none */ { return EMPTY_ARRAY }
|
|
385
385
|
| LPAREN input_value_definition_list RPAREN { return val[1] }
|
|
386
386
|
|
|
387
387
|
field_definition:
|
|
@@ -390,7 +390,7 @@ rule
|
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
field_definition_list:
|
|
393
|
-
/* none */ { return
|
|
393
|
+
/* none */ { return EMPTY_ARRAY }
|
|
394
394
|
| field_definition { return [val[0]] }
|
|
395
395
|
| field_definition_list field_definition { val[0] << val[1] }
|
|
396
396
|
|
|
@@ -433,7 +433,10 @@ end
|
|
|
433
433
|
|
|
434
434
|
---- inner ----
|
|
435
435
|
|
|
436
|
+
EMPTY_ARRAY = [].freeze
|
|
437
|
+
|
|
436
438
|
def initialize(query_string, filename:, tracer: Tracing::NullTracer)
|
|
439
|
+
raise GraphQL::ParseError.new("No query string was present", nil, nil, query_string) if query_string.nil?
|
|
437
440
|
@query_string = query_string
|
|
438
441
|
@filename = filename
|
|
439
442
|
@tracer = tracer
|