graphql 1.12.6 → 1.12.11
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 +4 -4
- data/lib/generators/graphql/install_generator.rb +1 -1
- data/lib/generators/graphql/templates/graphql_controller.erb +2 -2
- data/lib/graphql.rb +10 -10
- data/lib/graphql/backtrace/table.rb +14 -2
- data/lib/graphql/dataloader.rb +44 -15
- data/lib/graphql/execution/errors.rb +109 -11
- data/lib/graphql/execution/execute.rb +1 -1
- data/lib/graphql/execution/interpreter.rb +4 -8
- data/lib/graphql/execution/interpreter/runtime.rb +207 -188
- data/lib/graphql/introspection.rb +1 -1
- data/lib/graphql/introspection/directive_type.rb +7 -3
- data/lib/graphql/introspection/schema_type.rb +1 -1
- data/lib/graphql/pagination/active_record_relation_connection.rb +7 -0
- data/lib/graphql/pagination/connections.rb +1 -1
- data/lib/graphql/pagination/relation_connection.rb +8 -1
- data/lib/graphql/query.rb +1 -3
- data/lib/graphql/query/null_context.rb +7 -1
- data/lib/graphql/query/validation_pipeline.rb +1 -1
- data/lib/graphql/rake_task.rb +3 -0
- data/lib/graphql/schema.rb +49 -237
- data/lib/graphql/schema/addition.rb +238 -0
- data/lib/graphql/schema/argument.rb +55 -36
- data/lib/graphql/schema/directive/transform.rb +13 -1
- data/lib/graphql/schema/input_object.rb +2 -2
- data/lib/graphql/schema/loader.rb +8 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +3 -15
- data/lib/graphql/schema/object.rb +19 -5
- data/lib/graphql/schema/resolver.rb +46 -24
- data/lib/graphql/schema/scalar.rb +3 -1
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +3 -1
- data/lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb +6 -2
- data/lib/graphql/static_validation/rules/arguments_are_defined.rb +2 -1
- data/lib/graphql/static_validation/rules/arguments_are_defined_error.rb +4 -2
- data/lib/graphql/static_validation/rules/directives_are_defined.rb +1 -1
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +17 -8
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +1 -1
- data/lib/graphql/static_validation/validator.rb +5 -0
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +4 -3
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +0 -3
- data/lib/graphql/subscriptions/serialize.rb +11 -1
- data/lib/graphql/types/relay/base_connection.rb +4 -0
- data/lib/graphql/types/relay/connection_behaviors.rb +21 -10
- data/lib/graphql/types/relay/edge_behaviors.rb +12 -1
- data/lib/graphql/version.rb +1 -1
- metadata +3 -3
- data/lib/graphql/execution/interpreter/hash_response.rb +0 -46
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module GraphQL
|
|
4
|
-
module Execution
|
|
5
|
-
class Interpreter
|
|
6
|
-
# This response class handles `#write` by accumulating
|
|
7
|
-
# values into a Hash.
|
|
8
|
-
class HashResponse
|
|
9
|
-
def initialize
|
|
10
|
-
@result = {}
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def final_value
|
|
14
|
-
@result
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def inspect
|
|
18
|
-
"#<#{self.class.name} result=#{@result.inspect}>"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Add `value` at `path`.
|
|
22
|
-
# @return [void]
|
|
23
|
-
def write(path, value)
|
|
24
|
-
if path.empty?
|
|
25
|
-
@result = value
|
|
26
|
-
elsif (write_target = @result)
|
|
27
|
-
i = 0
|
|
28
|
-
prefinal_steps = path.size - 1
|
|
29
|
-
# Use `while` to avoid a closure
|
|
30
|
-
while i < prefinal_steps
|
|
31
|
-
path_part = path[i]
|
|
32
|
-
i += 1
|
|
33
|
-
write_target = write_target[path_part]
|
|
34
|
-
end
|
|
35
|
-
path_part = path[i]
|
|
36
|
-
write_target[path_part] = value
|
|
37
|
-
else
|
|
38
|
-
# The response is completely nulled out
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
nil
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|