graphql 2.0.9 → 2.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/execution/interpreter/runtime.rb +10 -8
  3. data/lib/graphql/execution/lazy.rb +0 -7
  4. data/lib/graphql/language/lexer.rb +42 -25
  5. data/lib/graphql/language/lexer.rl +26 -6
  6. data/lib/graphql/language/printer.rb +8 -5
  7. data/lib/graphql/pagination/relation_connection.rb +2 -0
  8. data/lib/graphql/query/validation_pipeline.rb +4 -0
  9. data/lib/graphql/query/variable_validation_error.rb +2 -2
  10. data/lib/graphql/query/variables.rb +13 -3
  11. data/lib/graphql/query.rb +10 -1
  12. data/lib/graphql/rake_task/validate.rb +1 -1
  13. data/lib/graphql/rake_task.rb +1 -0
  14. data/lib/graphql/schema/addition.rb +1 -1
  15. data/lib/graphql/schema/argument.rb +25 -13
  16. data/lib/graphql/schema/enum.rb +1 -1
  17. data/lib/graphql/schema/field.rb +14 -11
  18. data/lib/graphql/schema/input_object.rb +1 -1
  19. data/lib/graphql/schema/list.rb +19 -5
  20. data/lib/graphql/schema/member/has_arguments.rb +8 -2
  21. data/lib/graphql/schema/member/validates_input.rb +2 -2
  22. data/lib/graphql/schema/non_null.rb +2 -2
  23. data/lib/graphql/schema/scalar.rb +1 -1
  24. data/lib/graphql/schema.rb +17 -3
  25. data/lib/graphql/static_validation/error.rb +2 -2
  26. data/lib/graphql/static_validation/rules/directives_are_defined.rb +11 -5
  27. data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +12 -6
  28. data/lib/graphql/subscriptions.rb +3 -6
  29. data/lib/graphql/tracing/platform_tracing.rb +14 -17
  30. data/lib/graphql/tracing.rb +0 -1
  31. data/lib/graphql/version.rb +1 -1
  32. metadata +3 -4
  33. data/lib/graphql/tracing/opentelemetry_tracing.rb +0 -101
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39d95cd85a336ff82b22df87f496df97db11ecae05dbf80d090d5bb51445a499
4
- data.tar.gz: b50ecc9d63922cbe1e7cbbd7d9a049528625584fb0bd6991918e867f8d6e2e45
3
+ metadata.gz: b8f389d3b7c8052a74ccd4bd9e8412a1fa9d93415e6caeec883b8f179a167395
4
+ data.tar.gz: f2e6ab7ba5c1e76b0c44557855ab3af55fb2b718b8de1ff6483917de603734b3
5
5
  SHA512:
6
- metadata.gz: b404ea0ca0c0a1b4206330514da8d38c5e5f31abd4c93ebc696c91c2177f25e7f40703016742aeb6f8857f1bd208b9012778a21643a7ae08709bd08c994b31eb
7
- data.tar.gz: 5d41fa5df69f4722bf0bffaca89675b77ff7cb4b1af863550bb5908e03135f82214f516c092b83273c3ff367d20c845a000db9d5bbf5f8e43a3db0a0640a0095
6
+ metadata.gz: 10a24271a65c65a402d3243d2e43b3b257f74eb7bbc0ec13c254304bdce3122c444a41fbccf943bd3d626d301aec4b973485f742b831e8658ea252a0c95cfcfa
7
+ data.tar.gz: 9762008c699f2a53b14913e057dc31ec6c97b4203b1dd28a7a2a4fc18153d5bc200d0a95e3d2a04da80d0486131f5b1ce8d597e1ad6a7085b0766e35e0982959
@@ -401,8 +401,7 @@ module GraphQL
401
401
  end
402
402
  return_type = field_defn.type
403
403
 
404
- next_path = path.dup
405
- next_path << result_name
404
+ next_path = path + [result_name]
406
405
  next_path.freeze
407
406
 
408
407
  # This seems janky, but we need to know
@@ -685,12 +684,16 @@ module GraphQL
685
684
  set_result(selection_result, result_name, r)
686
685
  r
687
686
  when "UNION", "INTERFACE"
688
- resolved_type_or_lazy, resolved_value = resolve_type(current_type, value, path)
689
- resolved_value ||= value
687
+ resolved_type_or_lazy = resolve_type(current_type, value, path)
688
+ after_lazy(resolved_type_or_lazy, owner: current_type, path: path, ast_node: ast_node, field: field, owner_object: owner_object, arguments: arguments, trace: false, result_name: result_name, result: selection_result) do |resolved_type_result|
689
+ if resolved_type_result.is_a?(Array) && resolved_type_result.length == 2
690
+ resolved_type, resolved_value = resolved_type_result
691
+ else
692
+ resolved_type = resolved_type_result
693
+ resolved_value = value
694
+ end
690
695
 
691
- after_lazy(resolved_type_or_lazy, owner: current_type, path: path, ast_node: ast_node, field: field, owner_object: owner_object, arguments: arguments, trace: false, result_name: result_name, result: selection_result) do |resolved_type|
692
696
  possible_types = query.possible_types(current_type)
693
-
694
697
  if !possible_types.include?(resolved_type)
695
698
  parent_type = field.owner_type
696
699
  err_class = current_type::UnresolvedTypeError
@@ -764,8 +767,7 @@ module GraphQL
764
767
  set_result(selection_result, result_name, response_list)
765
768
  result_was_set = true
766
769
  end
767
- next_path = path.dup
768
- next_path << idx
770
+ next_path = path + [idx]
769
771
  this_idx = idx
770
772
  next_path.freeze
771
773
  idx += 1
@@ -12,13 +12,6 @@ module GraphQL
12
12
  # - It has no error-catching functionality
13
13
  # @api private
14
14
  class Lazy
15
- # Traverse `val`, lazily resolving any values along the way
16
- # @param val [Object] A data structure containing mixed plain values and `Lazy` instances
17
- # @return void
18
- def self.resolve(val)
19
- Resolve.resolve(val)
20
- end
21
-
22
15
  attr_reader :path, :field
23
16
 
24
17
  # Create a {Lazy} which will get its inner value by calling the block
@@ -11,18 +11,36 @@ end
11
11
  # To avoid allocating more strings, this modifies the string passed into it
12
12
  def self.replace_escaped_characters_in_place(raw_string)
13
13
  raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
14
- raw_string.gsub!(UTF_8, &UTF_8_REPLACE)
15
- nil
14
+ raw_string.gsub!(UTF_8) do |_matched_str|
15
+ codepoint_1 = ($1 || $2).to_i(16)
16
+ codepoint_2 = $3
17
+
18
+ if codepoint_2
19
+ codepoint_2 = codepoint_2.to_i(16)
20
+ if (codepoint_1 >= 0xD800 && codepoint_1 <= 0xDBFF) && # leading surrogate
21
+ (codepoint_2 >= 0xDC00 && codepoint_2 <= 0xDFFF) # trailing surrogate
22
+ # A surrogate pair
23
+ combined = ((codepoint_1 - 0xD800) * 0x400) + (codepoint_2 - 0xDC00) + 0x10000
24
+ [combined].pack('U'.freeze)
25
+ else
26
+ # Two separate code points
27
+ [codepoint_1].pack('U'.freeze) + [codepoint_2].pack('U'.freeze)
28
+ end
29
+ else
30
+ [codepoint_1].pack('U'.freeze)
31
+ end
16
32
  end
17
-
18
- private
19
-
20
- class << self
33
+ nil
34
+ end
35
+
36
+ private
37
+
38
+ class << self
21
39
  attr_accessor :_graphql_lexer_trans_keys
22
40
  private :_graphql_lexer_trans_keys, :_graphql_lexer_trans_keys=
23
41
  end
24
42
  self._graphql_lexer_trans_keys = [
25
- 1, 0, 4, 22, 4, 43, 14, 46, 14, 46, 14, 46, 14, 46, 4, 22, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 14, 15, 14, 15, 10, 15, 12, 12, 4, 22, 4, 43, 14, 46, 14, 46, 14, 46, 14, 46, 0, 49, 0, 0, 4, 22, 4, 4, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 1, 1, 14, 15, 10, 29, 14, 15, 10, 29, 10, 29, 12, 12, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 4, 4, 0 ,
43
+ 1, 0, 4, 22, 4, 43, 14, 47, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 49, 4, 22, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 14, 15, 14, 15, 10, 15, 12, 12, 4, 22, 4, 43, 14, 47, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 49, 0, 49, 0, 0, 4, 22, 4, 4, 4, 4, 4, 4, 4, 22, 4, 4, 4, 4, 1, 1, 14, 15, 10, 29, 14, 15, 10, 29, 10, 29, 12, 12, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 14, 46, 4, 4, 0 ,
26
44
  ]
27
45
 
28
46
  class << self
@@ -38,7 +56,7 @@ class << self
38
56
  private :_graphql_lexer_index_offsets, :_graphql_lexer_index_offsets=
39
57
  end
40
58
  self._graphql_lexer_index_offsets = [
41
- 0, 0, 19, 59, 92, 125, 158, 191, 210, 211, 212, 231, 232, 233, 235, 237, 243, 244, 263, 303, 336, 369, 402, 435, 485, 486, 505, 506, 507, 508, 527, 528, 529, 530, 532, 552, 554, 574, 594, 595, 628, 661, 694, 727, 760, 793, 826, 859, 892, 925, 958, 991, 1024, 1057, 1090, 1123, 1156, 1189, 1222, 1255, 1288, 1321, 1354, 1387, 1420, 1453, 1486, 1519, 1552, 1585, 1618, 1651, 1684, 1717, 1750, 1783, 1816, 1849, 1882, 1915, 1948, 1981, 2014, 2047, 2080, 2113, 2146, 2179, 2212, 2245, 2278, 2311, 2344, 2377, 2410, 2443, 2476, 2509, 2542, 2575, 2608, 2641, 2674, 2707, 2740, 2773, 2806, 2839, 2872, 2905, 2938, 2971, 3004, 3037, 3070, 3103, 3136, 3169, 3202, 3235, 3268, 3301, 3334, 3367, 3400, 3433, 3466, 3499, 3532, 3565, 3598, 3631, 3664, 3697, 3730, 0 ,
59
+ 0, 0, 19, 59, 93, 126, 159, 192, 225, 258, 291, 324, 360, 379, 380, 381, 400, 401, 402, 404, 406, 412, 413, 432, 472, 506, 539, 572, 605, 638, 671, 704, 737, 773, 823, 824, 843, 844, 845, 846, 865, 866, 867, 868, 870, 890, 892, 912, 932, 933, 966, 999, 1032, 1065, 1098, 1131, 1164, 1197, 1230, 1263, 1296, 1329, 1362, 1395, 1428, 1461, 1494, 1527, 1560, 1593, 1626, 1659, 1692, 1725, 1758, 1791, 1824, 1857, 1890, 1923, 1956, 1989, 2022, 2055, 2088, 2121, 2154, 2187, 2220, 2253, 2286, 2319, 2352, 2385, 2418, 2451, 2484, 2517, 2550, 2583, 2616, 2649, 2682, 2715, 2748, 2781, 2814, 2847, 2880, 2913, 2946, 2979, 3012, 3045, 3078, 3111, 3144, 3177, 3210, 3243, 3276, 3309, 3342, 3375, 3408, 3441, 3474, 3507, 3540, 3573, 3606, 3639, 3672, 3705, 3738, 3771, 3804, 3837, 3870, 3903, 3936, 3969, 4002, 4035, 4068, 0 ,
42
60
  ]
43
61
 
44
62
  class << self
@@ -46,7 +64,7 @@ class << self
46
64
  private :_graphql_lexer_indicies, :_graphql_lexer_indicies=
47
65
  end
48
66
  self._graphql_lexer_indicies = [
49
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 4, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 0, 0, 0, 6, 6, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 12, 13, 14, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 15, 16, 17, 17, 19, 19, 20, 20, 8, 8, 17, 17, 21, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 24, 22, 25, 25, 25, 25, 25, 25, 25, 25, 22, 25, 25, 25, 25, 25, 25, 25, 25, 22, 25, 25, 25, 22, 25, 25, 25, 22, 25, 25, 25, 25, 25, 22, 25, 25, 25, 22, 25, 22, 26, 27, 27, 25, 25, 25, 27, 27, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 25, 25, 25, 28, 28, 25, 25, 25, 25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 25, 25, 25, 29, 29, 25, 25, 25, 25, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 22, 22, 25, 25, 25, 22, 22, 25, 25, 25, 25, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 31, 32, 30, 33, 34, 35, 36, 37, 38, 39, 30, 40, 41, 30, 42, 43, 44, 45, 46, 47, 47, 48, 30, 49, 47, 47, 47, 47, 50, 51, 52, 47, 47, 53, 47, 54, 55, 56, 47, 57, 58, 59, 60, 61, 47, 47, 47, 62, 63, 64, 31, 67, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 9, 70, 71, 72, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 73, 13, 74, 42, 43, 20, 20, 76, 75, 17, 17, 75, 75, 75, 75, 77, 75, 75, 75, 75, 75, 75, 75, 75, 77, 17, 17, 20, 20, 78, 78, 19, 19, 78, 78, 78, 78, 77, 78, 78, 78, 78, 78, 78, 78, 78, 77, 20, 20, 76, 75, 43, 43, 75, 75, 75, 75, 77, 75, 75, 75, 75, 75, 75, 75, 75, 77, 79, 47, 47, 8, 8, 8, 47, 47, 8, 8, 8, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 81, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 82, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 83, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 84, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 85, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 86, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 87, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 88, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 89, 47, 47, 47, 47, 47, 47, 47, 47, 90, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 91, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 92, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 93, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 94, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 95, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 96, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 97, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 98, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 99, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 100, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 101, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 102, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 103, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 104, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 105, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 106, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 107, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 108, 109, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 110, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 111, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 112, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 113, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 114, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 115, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 116, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 117, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 118, 47, 47, 47, 119, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 120, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 121, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 122, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 123, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 124, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 125, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 126, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 127, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 128, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 129, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 130, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 131, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 132, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 133, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 134, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 135, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 136, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 137, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 138, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 139, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 140, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 141, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 142, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 143, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 144, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 145, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 146, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 147, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 148, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 149, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 150, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 151, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 152, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 153, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 154, 47, 47, 47, 47, 47, 47, 155, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 156, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 157, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 158, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 159, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 160, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 161, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 162, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 163, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 164, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 165, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 166, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 167, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 168, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 169, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 170, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 171, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 172, 47, 47, 47, 47, 47, 173, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 174, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 175, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 176, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 177, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 178, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 179, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 180, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 80, 80, 80, 47, 47, 80, 80, 80, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 181, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 22, 0 ,
67
+ 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 4, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 0, 0, 0, 8, 8, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 0, 0, 0, 9, 9, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 0, 0, 0, 10, 10, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 0, 0, 0, 11, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 0, 0, 0, 12, 12, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 12, 12, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 1, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 17, 18, 19, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 20, 21, 22, 22, 24, 24, 25, 25, 13, 13, 22, 22, 26, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 29, 27, 30, 30, 30, 30, 30, 30, 30, 30, 27, 30, 30, 30, 30, 30, 30, 30, 30, 27, 30, 30, 30, 27, 30, 30, 30, 27, 30, 30, 30, 30, 30, 27, 30, 30, 30, 27, 30, 27, 31, 32, 32, 30, 30, 30, 32, 32, 30, 30, 30, 30, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 34, 34, 30, 30, 30, 34, 34, 30, 30, 30, 30, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 35, 30, 30, 30, 35, 35, 30, 30, 30, 30, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 27, 27, 30, 30, 30, 27, 27, 30, 30, 30, 30, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 36, 36, 30, 30, 30, 36, 36, 30, 30, 30, 30, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 37, 30, 30, 30, 37, 37, 30, 30, 30, 30, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 38, 38, 30, 30, 30, 38, 38, 30, 30, 30, 30, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 30, 30, 30, 39, 39, 30, 30, 30, 30, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 30, 30, 30, 39, 39, 30, 30, 30, 30, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 30, 30, 27, 41, 42, 40, 43, 44, 45, 46, 47, 48, 49, 40, 50, 51, 40, 52, 53, 54, 55, 56, 57, 57, 58, 40, 59, 57, 57, 57, 57, 60, 61, 62, 57, 57, 63, 57, 64, 65, 66, 57, 67, 68, 69, 70, 71, 57, 57, 57, 72, 73, 74, 41, 77, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 14, 80, 81, 82, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 16, 83, 18, 84, 52, 53, 25, 25, 86, 85, 22, 22, 85, 85, 85, 85, 87, 85, 85, 85, 85, 85, 85, 85, 85, 87, 22, 22, 25, 25, 88, 88, 24, 24, 88, 88, 88, 88, 87, 88, 88, 88, 88, 88, 88, 88, 88, 87, 25, 25, 86, 85, 53, 53, 85, 85, 85, 85, 87, 85, 85, 85, 85, 85, 85, 85, 85, 87, 89, 57, 57, 13, 13, 13, 57, 57, 13, 13, 13, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 91, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 92, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 93, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 94, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 95, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 96, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 97, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 98, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 99, 57, 57, 57, 57, 57, 57, 57, 57, 100, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 101, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 102, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 103, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 104, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 105, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 106, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 107, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 108, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 109, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 110, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 111, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 112, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 113, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 114, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 115, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 116, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 117, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 118, 119, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 120, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 121, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 122, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 123, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 124, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 125, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 126, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 127, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 128, 57, 57, 57, 129, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 130, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 131, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 132, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 133, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 134, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 135, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 136, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 137, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 138, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 139, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 140, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 141, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 142, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 143, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 144, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 145, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 146, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 147, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 148, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 149, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 150, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 151, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 152, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 153, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 154, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 155, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 156, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 157, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 158, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 159, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 160, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 161, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 162, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 163, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 164, 57, 57, 57, 57, 57, 57, 165, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 166, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 167, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 168, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 169, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 170, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 171, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 172, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 173, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 174, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 175, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 176, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 177, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 178, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 179, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 180, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 181, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 182, 57, 57, 57, 57, 57, 183, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 184, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 185, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 186, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 187, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 188, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 189, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 190, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 90, 90, 90, 57, 57, 90, 90, 90, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 191, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 27, 0 ,
50
68
  ]
51
69
 
52
70
  class << self
@@ -54,7 +72,7 @@ class << self
54
72
  private :_graphql_lexer_index_defaults, :_graphql_lexer_index_defaults=
55
73
  end
56
74
  self._graphql_lexer_index_defaults = [
57
- 0, 1, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 8, 18, 8, 0, 22, 25, 25, 25, 25, 25, 30, 65, 1, 68, 69, 69, 9, 9, 9, 35, 66, 75, 78, 78, 75, 66, 8, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 25, 0 ,
75
+ 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 14, 14, 14, 13, 23, 13, 0, 27, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 40, 75, 1, 78, 79, 79, 14, 14, 14, 45, 76, 85, 88, 88, 85, 76, 13, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 30, 0 ,
58
76
  ]
59
77
 
60
78
  class << self
@@ -62,7 +80,7 @@ class << self
62
80
  private :_graphql_lexer_trans_cond_spaces, :_graphql_lexer_trans_cond_spaces=
63
81
  end
64
82
  self._graphql_lexer_trans_cond_spaces = [
65
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 ,
83
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0 ,
66
84
  ]
67
85
 
68
86
  class << self
@@ -70,7 +88,7 @@ class << self
70
88
  private :_graphql_lexer_cond_targs, :_graphql_lexer_cond_targs=
71
89
  end
72
90
  self._graphql_lexer_cond_targs = [
73
- 23, 1, 23, 2, 3, 4, 5, 6, 23, 7, 8, 10, 9, 27, 11, 12, 29, 35, 23, 36, 13, 23, 17, 134, 18, 0, 19, 20, 21, 22, 23, 24, 23, 23, 25, 32, 23, 23, 23, 23, 33, 38, 34, 37, 23, 23, 23, 39, 23, 23, 40, 48, 55, 65, 83, 90, 93, 94, 98, 107, 125, 130, 23, 23, 23, 23, 23, 26, 23, 23, 28, 23, 30, 31, 23, 23, 14, 15, 23, 16, 23, 41, 42, 43, 44, 45, 46, 47, 39, 49, 51, 50, 39, 52, 53, 54, 39, 56, 59, 57, 58, 39, 60, 61, 62, 63, 64, 39, 66, 74, 67, 68, 69, 70, 71, 72, 73, 39, 75, 77, 76, 39, 78, 79, 80, 81, 82, 39, 84, 85, 86, 87, 88, 89, 39, 91, 92, 39, 39, 95, 96, 97, 39, 99, 100, 101, 102, 103, 104, 105, 106, 39, 108, 115, 109, 112, 110, 111, 39, 113, 114, 39, 116, 117, 118, 119, 120, 121, 122, 123, 124, 39, 126, 128, 127, 39, 129, 39, 131, 132, 133, 39, 0 ,
91
+ 33, 1, 33, 2, 3, 4, 7, 5, 6, 8, 9, 10, 11, 33, 12, 13, 15, 14, 37, 16, 17, 39, 45, 33, 46, 18, 33, 22, 144, 23, 0, 24, 25, 28, 26, 27, 29, 30, 31, 32, 33, 34, 33, 33, 35, 42, 33, 33, 33, 33, 43, 48, 44, 47, 33, 33, 33, 49, 33, 33, 50, 58, 65, 75, 93, 100, 103, 104, 108, 117, 135, 140, 33, 33, 33, 33, 33, 36, 33, 33, 38, 33, 40, 41, 33, 33, 19, 20, 33, 21, 33, 51, 52, 53, 54, 55, 56, 57, 49, 59, 61, 60, 49, 62, 63, 64, 49, 66, 69, 67, 68, 49, 70, 71, 72, 73, 74, 49, 76, 84, 77, 78, 79, 80, 81, 82, 83, 49, 85, 87, 86, 49, 88, 89, 90, 91, 92, 49, 94, 95, 96, 97, 98, 99, 49, 101, 102, 49, 49, 105, 106, 107, 49, 109, 110, 111, 112, 113, 114, 115, 116, 49, 118, 125, 119, 122, 120, 121, 49, 123, 124, 49, 126, 127, 128, 129, 130, 131, 132, 133, 134, 49, 136, 138, 137, 49, 139, 49, 141, 142, 143, 49, 0 ,
74
92
  ]
75
93
 
76
94
  class << self
@@ -78,7 +96,7 @@ class << self
78
96
  private :_graphql_lexer_cond_actions, :_graphql_lexer_cond_actions=
79
97
  end
80
98
  self._graphql_lexer_cond_actions = [
81
- 1, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 6, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 11, 0, 12, 13, 14, 0, 15, 16, 17, 18, 0, 14, 19, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 0, 34, 4, 4, 35, 36, 0, 0, 37, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 45, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 55, 0, 56, 0, 0, 0, 57, 0 ,
99
+ 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, 0, 5, 6, 0, 7, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 12, 13, 14, 0, 15, 16, 17, 18, 0, 14, 19, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 27, 28, 29, 30, 31, 32, 33, 0, 34, 4, 4, 35, 36, 0, 0, 37, 0, 38, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 0, 40, 0, 0, 0, 41, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 45, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 47, 0, 0, 48, 49, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 52, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 55, 0, 56, 0, 0, 0, 57, 0 ,
82
100
  ]
83
101
 
84
102
  class << self
@@ -86,7 +104,7 @@ class << self
86
104
  private :_graphql_lexer_to_state_actions, :_graphql_lexer_to_state_actions=
87
105
  end
88
106
  self._graphql_lexer_to_state_actions = [
89
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0 ,
107
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0 ,
90
108
  ]
91
109
 
92
110
  class << self
@@ -94,7 +112,7 @@ class << self
94
112
  private :_graphql_lexer_from_state_actions, :_graphql_lexer_from_state_actions=
95
113
  end
96
114
  self._graphql_lexer_from_state_actions = [
97
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0 ,
115
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0 ,
98
116
  ]
99
117
 
100
118
  class << self
@@ -102,7 +120,7 @@ class << self
102
120
  private :_graphql_lexer_eof_trans, :_graphql_lexer_eof_trans=
103
121
  end
104
122
  self._graphql_lexer_eof_trans = [
105
- 0, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 19, 9, 1, 0, 0, 0, 0, 0, 0, 0, 66, 67, 69, 70, 70, 70, 70, 70, 75, 67, 76, 79, 79, 76, 67, 9, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 0, 0 ,
123
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, 14, 14, 14, 24, 14, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 79, 80, 80, 80, 80, 80, 85, 77, 86, 89, 89, 86, 77, 14, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 0, 0 ,
106
124
  ]
107
125
 
108
126
  class << self
@@ -118,7 +136,7 @@ class << self
118
136
  private :_graphql_lexer_nfa_offsets, :_graphql_lexer_nfa_offsets=
119
137
  end
120
138
  self._graphql_lexer_nfa_offsets = [
121
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,
139
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,
122
140
  ]
123
141
 
124
142
  class << self
@@ -140,12 +158,12 @@ self._graphql_lexer_nfa_pop_trans = [
140
158
  class << self
141
159
  attr_accessor :graphql_lexer_start
142
160
  end
143
- self.graphql_lexer_start = 23;
161
+ self.graphql_lexer_start = 33;
144
162
 
145
163
  class << self
146
164
  attr_accessor :graphql_lexer_first_final
147
165
  end
148
- self.graphql_lexer_first_final = 23;
166
+ self.graphql_lexer_first_final = 33;
149
167
 
150
168
  class << self
151
169
  attr_accessor :graphql_lexer_error
@@ -155,12 +173,12 @@ self.graphql_lexer_error = 0;
155
173
  class << self
156
174
  attr_accessor :graphql_lexer_en_str
157
175
  end
158
- self.graphql_lexer_en_str = 134;
176
+ self.graphql_lexer_en_str = 144;
159
177
 
160
178
  class << self
161
179
  attr_accessor :graphql_lexer_en_main
162
180
  end
163
- self.graphql_lexer_en_main = 23;
181
+ self.graphql_lexer_en_main = 33;
164
182
 
165
183
  def self.run_lexer(query_string)
166
184
  data = query_string.unpack(PACK_DIRECTIVE)
@@ -1435,8 +1453,8 @@ ESCAPES_REPLACE = {
1435
1453
  "\\t" => "\t",
1436
1454
  }
1437
1455
 
1438
- UTF_8 = /\\u[\dAa-f]{4}/i
1439
- UTF_8_REPLACE = ->(m) { [m[-4..-1].to_i(16)].pack('U'.freeze) }
1456
+ UTF_8 = /\\u(?:([\dAa-f]{4})|\{([\da-f]{4,})\})(?:\\u([\dAa-f]{4}))?/i
1457
+
1440
1458
 
1441
1459
  VALID_STRING = /\A(?:[^\\]|#{ESCAPES}|#{UTF_8})*\z/o
1442
1460
 
@@ -1451,8 +1469,7 @@ if block && !value.empty?
1451
1469
  line_incr = value.count("\n")
1452
1470
  value = GraphQL::Language::BlockString.trim_whitespace(value)
1453
1471
  end
1454
- # TODO: replace with `String#match?` when we support only Ruby 2.4+
1455
- # (It's faster: https://bugs.ruby-lang.org/issues/8110)
1472
+
1456
1473
  if !value.valid_encoding? || !value.match?(VALID_STRING)
1457
1474
  meta[:tokens] << token = GraphQL::Language::Token.new(
1458
1475
  :BAD_UNICODE_ESCAPE,
@@ -39,7 +39,10 @@
39
39
  BACKSLASH = '\\';
40
40
  # Could limit to hex here, but “bad unicode escape” on 0XXF is probably a
41
41
  # more helpful error than “unknown char”
42
- UNICODE_ESCAPE = '\\u' [0-9A-Za-z]{4};
42
+ UNICODE_DIGIT = [0-9A-Za-z];
43
+ FOUR_DIGIT_UNICODE = UNICODE_DIGIT{4};
44
+ N_DIGIT_UNICODE = LCURLY UNICODE_DIGIT{4,} RCURLY;
45
+ UNICODE_ESCAPE = '\\u' (FOUR_DIGIT_UNICODE | N_DIGIT_UNICODE);
43
46
  # https://graphql.github.io/graphql-spec/June2018/#sec-String-Value
44
47
  STRING_ESCAPE = '\\' [\\/bfnrt];
45
48
  BLOCK_QUOTE = '"""';
@@ -131,7 +134,25 @@ module GraphQL
131
134
  # To avoid allocating more strings, this modifies the string passed into it
132
135
  def self.replace_escaped_characters_in_place(raw_string)
133
136
  raw_string.gsub!(ESCAPES, ESCAPES_REPLACE)
134
- raw_string.gsub!(UTF_8, &UTF_8_REPLACE)
137
+ raw_string.gsub!(UTF_8) do |_matched_str|
138
+ codepoint_1 = ($1 || $2).to_i(16)
139
+ codepoint_2 = $3
140
+
141
+ if codepoint_2
142
+ codepoint_2 = codepoint_2.to_i(16)
143
+ if (codepoint_1 >= 0xD800 && codepoint_1 <= 0xDBFF) && # leading surrogate
144
+ (codepoint_2 >= 0xDC00 && codepoint_2 <= 0xDFFF) # trailing surrogate
145
+ # A surrogate pair
146
+ combined = ((codepoint_1 - 0xD800) * 0x400) + (codepoint_2 - 0xDC00) + 0x10000
147
+ [combined].pack('U'.freeze)
148
+ else
149
+ # Two separate code points
150
+ [codepoint_1].pack('U'.freeze) + [codepoint_2].pack('U'.freeze)
151
+ end
152
+ else
153
+ [codepoint_1].pack('U'.freeze)
154
+ end
155
+ end
135
156
  nil
136
157
  end
137
158
 
@@ -203,8 +224,8 @@ module GraphQL
203
224
  "\\t" => "\t",
204
225
  }
205
226
 
206
- UTF_8 = /\\u[\dAa-f]{4}/i
207
- UTF_8_REPLACE = ->(m) { [m[-4..-1].to_i(16)].pack('U'.freeze) }
227
+ UTF_8 = /\\u(?:([\dAa-f]{4})|\{([\da-f]{4,})\})(?:\\u([\dAa-f]{4}))?/i
228
+
208
229
 
209
230
  VALID_STRING = /\A(?:[^\\]|#{ESCAPES}|#{UTF_8})*\z/o
210
231
 
@@ -219,8 +240,7 @@ module GraphQL
219
240
  line_incr = value.count("\n")
220
241
  value = GraphQL::Language::BlockString.trim_whitespace(value)
221
242
  end
222
- # TODO: replace with `String#match?` when we support only Ruby 2.4+
223
- # (It's faster: https://bugs.ruby-lang.org/issues/8110)
243
+
224
244
  if !value.valid_encoding? || !value.match?(VALID_STRING)
225
245
  meta[:tokens] << token = GraphQL::Language::Token.new(
226
246
  :BAD_UNICODE_ESCAPE,
@@ -236,12 +236,15 @@ module GraphQL
236
236
  out = print_description(input_object_type)
237
237
  out << "input #{input_object_type.name}"
238
238
  out << print_directives(input_object_type.directives)
239
- out << " {\n"
240
- input_object_type.fields.each.with_index do |field, i|
241
- out << print_description(field, indent: ' ', first_in_block: i == 0)
242
- out << " #{print_input_value_definition(field)}\n"
239
+ if !input_object_type.fields.empty?
240
+ out << " {\n"
241
+ input_object_type.fields.each.with_index do |field, i|
242
+ out << print_description(field, indent: ' ', first_in_block: i == 0)
243
+ out << " #{print_input_value_definition(field)}\n"
244
+ end
245
+ out << "}"
243
246
  end
244
- out << "}"
247
+ out
245
248
  end
246
249
 
247
250
  def print_directive_definition(directive)
@@ -117,6 +117,8 @@ module GraphQL
117
117
  return
118
118
  else
119
119
  next_offset = relation_offset(items) || 0
120
+ relation_limit = relation_limit(items)
121
+
120
122
  if after_offset
121
123
  next_offset += after_offset
122
124
  end
@@ -45,6 +45,10 @@ module GraphQL
45
45
  @query_analyzers
46
46
  end
47
47
 
48
+ def has_validated?
49
+ @has_validated == true
50
+ end
51
+
48
52
  private
49
53
 
50
54
  # If the pipeline wasn't run yet, run it.
@@ -4,11 +4,11 @@ module GraphQL
4
4
  class VariableValidationError < GraphQL::ExecutionError
5
5
  attr_accessor :value, :validation_result
6
6
 
7
- def initialize(variable_ast, type, value, validation_result)
7
+ def initialize(variable_ast, type, value, validation_result, msg: nil)
8
8
  @value = value
9
9
  @validation_result = validation_result
10
10
 
11
- msg = "Variable $#{variable_ast.name} of type #{type.to_type_signature} was provided invalid value"
11
+ msg ||= "Variable $#{variable_ast.name} of type #{type.to_type_signature} was provided invalid value"
12
12
 
13
13
  if problem_fields.any?
14
14
  msg += " for #{problem_fields.join(", ")}"
@@ -17,6 +17,10 @@ module GraphQL
17
17
  @provided_variables = deep_stringify(provided_variables)
18
18
  @errors = []
19
19
  @storage = ast_variables.each_with_object({}) do |ast_variable, memo|
20
+ if schema.validate_max_errors && schema.validate_max_errors <= @errors.count
21
+ add_max_errors_reached_message
22
+ break
23
+ end
20
24
  # Find the right value for this variable:
21
25
  # - First, use the value provided at runtime
22
26
  # - Then, fall back to the default value from the query string
@@ -29,8 +33,9 @@ module GraphQL
29
33
  default_value = ast_variable.default_value
30
34
  provided_value = @provided_variables[variable_name]
31
35
  value_was_provided = @provided_variables.key?(variable_name)
36
+ max_errors = schema.validate_max_errors - @errors.count if schema.validate_max_errors
32
37
  begin
33
- validation_result = variable_type.validate_input(provided_value, ctx)
38
+ validation_result = variable_type.validate_input(provided_value, ctx, max_errors: max_errors)
34
39
  if validation_result.valid?
35
40
  if value_was_provided
36
41
  # Add the variable if a value was provided
@@ -48,8 +53,7 @@ module GraphQL
48
53
  # like InputValidationResults generated by validate_non_null_input but unfortunately we don't
49
54
  # have this information available in the coerce_input call chain. Note this path is the path
50
55
  # that appears under errors.extensions.problems.path and NOT the result path under errors.path.
51
- validation_result = GraphQL::Query::InputValidationResult.new
52
- validation_result.add_problem(ex.message)
56
+ validation_result = GraphQL::Query::InputValidationResult.from_problem(ex.message)
53
57
  end
54
58
 
55
59
  if !validation_result.valid?
@@ -76,6 +80,12 @@ module GraphQL
76
80
  else
77
81
  val
78
82
  end
83
+ end
84
+
85
+ def add_max_errors_reached_message
86
+ message = "Too many errors processing variables, max validation error limit reached. Execution aborted"
87
+ validation_result = GraphQL::Query::InputValidationResult.from_problem(message)
88
+ errors << GraphQL::Query::VariableValidationError.new(nil, nil, nil, validation_result, msg: message)
79
89
  end
80
90
  end
81
91
  end
data/lib/graphql/query.rb CHANGED
@@ -34,7 +34,16 @@ module GraphQL
34
34
  attr_accessor :operation_name
35
35
 
36
36
  # @return [Boolean] if false, static validation is skipped (execution behavior for invalid queries is undefined)
37
- attr_accessor :validate
37
+ attr_reader :validate
38
+
39
+ # @param new_validate [Boolean] if false, static validation is skipped. This can't be reasssigned after validation.
40
+ def validate=(new_validate)
41
+ if defined?(@validation_pipeline) && @validation_pipeline && @validation_pipeline.has_validated?
42
+ raise ArgumentError, "Can't reassign Query#validate= after validation has run, remove this assignment."
43
+ else
44
+ @validate = new_validate
45
+ end
46
+ end
38
47
 
39
48
  attr_writer :query_string
40
49
 
@@ -15,7 +15,7 @@ module GraphQL
15
15
  puts "Validating graphql-pro v#{version}"
16
16
  puts " - Checking for graphql-pro credentials..."
17
17
 
18
- creds = `bundle config gems.graphql.pro`[/[a-z0-9]{11}:[a-z0-9]{11}/]
18
+ creds = `bundle config gems.graphql.pro --parseable`[/[a-z0-9]{11}:[a-z0-9]{11}/]
19
19
  if creds.nil?
20
20
  puts " #{ex} failed, please set with `bundle config gems.graphql.pro $MY_CREDENTIALS`"
21
21
  exit(1)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require "fileutils"
3
+ require "rake"
3
4
  require "graphql/rake_task/validate"
4
5
 
5
6
  module GraphQL
@@ -151,7 +151,7 @@ module GraphQL
151
151
  um << owner
152
152
  end
153
153
 
154
- if (prev_type = get_local_type(type.graphql_name)) && prev_type == type
154
+ if (prev_type = get_local_type(type.graphql_name)) && (prev_type == type || (prev_type.is_a?(Array) && prev_type.include?(type)))
155
155
  # No need to re-visit
156
156
  elsif type.is_a?(Class) && type < GraphQL::Schema::Directive
157
157
  @directives << type
@@ -18,8 +18,14 @@ module GraphQL
18
18
  # @return [GraphQL::Schema::Field, Class] The field or input object this argument belongs to
19
19
  attr_reader :owner
20
20
 
21
- # @return [Symbol] A method to call to transform this value before sending it to field resolution method
22
- attr_reader :prepare
21
+ # @param new_prepare [Method, Proc]
22
+ # @return [Symbol] A method or proc to call to transform this value before sending it to field resolution method
23
+ def prepare(new_prepare = NO_DEFAULT)
24
+ if new_prepare != NO_DEFAULT
25
+ @prepare = new_prepare
26
+ end
27
+ @prepare
28
+ end
23
29
 
24
30
  # @return [Symbol] This argument's name in Ruby keyword arguments
25
31
  attr_reader :keyword
@@ -96,8 +102,14 @@ module GraphQL
96
102
  "#<#{self.class} #{path}: #{type.to_type_signature}#{description ? " @description=#{description.inspect}" : ""}>"
97
103
  end
98
104
 
105
+ # @param default_value [Object] The value to use when the client doesn't provide one
99
106
  # @return [Object] the value used when the client doesn't provide a value for this argument
100
- attr_reader :default_value
107
+ def default_value(new_default_value = NO_DEFAULT)
108
+ if new_default_value != NO_DEFAULT
109
+ @default_value = new_default_value
110
+ end
111
+ @default_value
112
+ end
101
113
 
102
114
  # @return [Boolean] True if this argument has a default value
103
115
  def default_value?
@@ -259,26 +271,26 @@ module GraphQL
259
271
  # If this isn't lazy, then the block returns eagerly and assigns the result here
260
272
  # If it _is_ lazy, then we write the lazy to the hash, then update it later
261
273
  argument_values[arg_key] = context.schema.after_lazy(coerced_value) do |resolved_coerced_value|
274
+ owner.validate_directive_argument(self, resolved_coerced_value)
275
+ prepared_value = begin
276
+ prepare_value(parent_object, resolved_coerced_value, context: context)
277
+ rescue StandardError => err
278
+ context.schema.handle_or_reraise(context, err)
279
+ end
280
+
262
281
  if loads && !from_resolver?
263
282
  loaded_value = begin
264
- load_and_authorize_value(owner, coerced_value, context)
283
+ load_and_authorize_value(owner, prepared_value, context)
265
284
  rescue StandardError => err
266
285
  context.schema.handle_or_reraise(context, err)
267
286
  end
268
287
  end
269
288
 
270
- maybe_loaded_value = loaded_value || resolved_coerced_value
289
+ maybe_loaded_value = loaded_value || prepared_value
271
290
  context.schema.after_lazy(maybe_loaded_value) do |resolved_loaded_value|
272
- owner.validate_directive_argument(self, resolved_loaded_value)
273
- prepared_value = begin
274
- prepare_value(parent_object, resolved_loaded_value, context: context)
275
- rescue StandardError => err
276
- context.schema.handle_or_reraise(context, err)
277
- end
278
-
279
291
  # TODO code smell to access such a deeply-nested constant in a distant module
280
292
  argument_values[arg_key] = GraphQL::Execution::Interpreter::ArgumentValue.new(
281
- value: prepared_value,
293
+ value: resolved_loaded_value,
282
294
  definition: self,
283
295
  default_used: default_used,
284
296
  )
@@ -122,7 +122,7 @@ module GraphQL
122
122
  GraphQL::TypeKinds::ENUM
123
123
  end
124
124
 
125
- def validate_non_null_input(value_name, ctx)
125
+ def validate_non_null_input(value_name, ctx, max_errors: nil)
126
126
  allowed_values = ctx.warden.enum_values(self)
127
127
  matching_value = allowed_values.find { |v| v.graphql_name == value_name }
128
128
 
@@ -181,6 +181,8 @@ module GraphQL
181
181
 
182
182
  # @return Boolean
183
183
  attr_reader :relay_node_field
184
+ # @return Boolean
185
+ attr_reader :relay_nodes_field
184
186
 
185
187
  # @return [Boolean] Should we warn if this field's name conflicts with a built-in method?
186
188
  def method_conflict_warning?
@@ -664,7 +666,18 @@ module GraphQL
664
666
  inner_object = obj.object
665
667
 
666
668
  if defined?(@hash_key)
667
- inner_object[@hash_key] || inner_object[@hash_key_str] || (@fallback_value != :not_given ? @fallback_value : nil)
669
+ hash_value = if inner_object.is_a?(Hash)
670
+ inner_object.key?(@hash_key) ? inner_object[@hash_key] : inner_object[@hash_key_str]
671
+ elsif inner_object.respond_to?(:[])
672
+ inner_object[@hash_key]
673
+ else
674
+ nil
675
+ end
676
+ if hash_value == false
677
+ hash_value
678
+ else
679
+ hash_value || (@fallback_value != :not_given ? @fallback_value : nil)
680
+ end
668
681
  elsif obj.respond_to?(resolver_method)
669
682
  method_to_call = resolver_method
670
683
  method_receiver = obj
@@ -677,16 +690,6 @@ module GraphQL
677
690
  elsif inner_object.is_a?(Hash)
678
691
  if @dig_keys
679
692
  inner_object.dig(*@dig_keys)
680
- elsif defined?(@hash_key)
681
- if inner_object.key?(@hash_key)
682
- inner_object[@hash_key]
683
- elsif inner_object.key?(@hash_key_str)
684
- inner_object[@hash_key_str]
685
- elsif @fallback_value != :not_given
686
- @fallback_value
687
- else
688
- nil
689
- end
690
693
  elsif inner_object.key?(@method_sym)
691
694
  inner_object[@method_sym]
692
695
  elsif inner_object.key?(@method_str)
@@ -126,7 +126,7 @@ module GraphQL
126
126
  # @api private
127
127
  INVALID_OBJECT_MESSAGE = "Expected %{object} to be a key-value object responding to `to_h` or `to_unsafe_h`."
128
128
 
129
- def validate_non_null_input(input, ctx)
129
+ def validate_non_null_input(input, ctx, max_errors: nil)
130
130
  warden = ctx.warden
131
131
 
132
132
  if input.is_a?(Array)
@@ -45,16 +45,24 @@ module GraphQL
45
45
  end
46
46
  end
47
47
 
48
- def validate_non_null_input(value, ctx)
49
- result = nil
48
+ def validate_non_null_input(value, ctx, max_errors: nil)
49
+ result = GraphQL::Query::InputValidationResult.new
50
50
  ensure_array(value).each_with_index do |item, index|
51
51
  item_result = of_type.validate_input(item, ctx)
52
- if !item_result.valid?
53
- result ||= GraphQL::Query::InputValidationResult.new
52
+ unless item_result.valid?
53
+ if max_errors
54
+ if max_errors == 0
55
+ add_max_errros_reached_message(result)
56
+ break
57
+ end
58
+
59
+ max_errors -= 1
60
+ end
61
+
54
62
  result.merge_result!(index, item_result)
55
63
  end
56
64
  end
57
- result
65
+ result.valid? ? nil : result
58
66
  end
59
67
 
60
68
  private
@@ -67,6 +75,12 @@ module GraphQL
67
75
  [value]
68
76
  end
69
77
  end
78
+
79
+ def add_max_errros_reached_message(result)
80
+ message = "Too many errors processing list variable, max validation error limit reached. Execution aborted"
81
+ item_result = GraphQL::Query::InputValidationResult.from_problem(message)
82
+ result.merge_result!(nil, item_result)
83
+ end
70
84
  end
71
85
  end
72
86
  end
@@ -323,8 +323,14 @@ module GraphQL
323
323
  end
324
324
  # Double-check that the located object is actually of this type
325
325
  # (Don't want to allow arbitrary access to objects this way)
326
- resolved_application_object_type = context.schema.resolve_type(argument.loads, application_object, context)
327
- context.schema.after_lazy(resolved_application_object_type) do |application_object_type|
326
+ maybe_lazy_resolve_type = context.schema.resolve_type(argument.loads, application_object, context)
327
+ context.schema.after_lazy(maybe_lazy_resolve_type) do |resolve_type_result|
328
+ if resolve_type_result.is_a?(Array) && resolve_type_result.size == 2
329
+ application_object_type, application_object = resolve_type_result
330
+ else
331
+ application_object_type = resolve_type_result
332
+ # application_object is already assigned
333
+ end
328
334
  possible_object_types = context.warden.possible_types(argument.loads)
329
335
  if !possible_object_types.include?(application_object_type)
330
336
  err = GraphQL::LoadApplicationObjectFailedError.new(argument: argument, id: id, object: application_object)
@@ -8,11 +8,11 @@ module GraphQL
8
8
  validate_input(val, ctx).valid?
9
9
  end
10
10
 
11
- def validate_input(val, ctx)
11
+ def validate_input(val, ctx, max_errors: nil)
12
12
  if val.nil?
13
13
  Query::InputValidationResult::VALID
14
14
  else
15
- validate_non_null_input(val, ctx) || Query::InputValidationResult::VALID
15
+ validate_non_null_input(val, ctx, max_errors: max_errors) || Query::InputValidationResult::VALID
16
16
  end
17
17
  end
18
18
 
@@ -31,13 +31,13 @@ module GraphQL
31
31
  "#<#{self.class.name} @of_type=#{@of_type.inspect}>"
32
32
  end
33
33
 
34
- def validate_input(value, ctx)
34
+ def validate_input(value, ctx, max_errors: nil)
35
35
  if value.nil?
36
36
  result = GraphQL::Query::InputValidationResult.new
37
37
  result.add_problem("Expected value to not be null")
38
38
  result
39
39
  else
40
- of_type.validate_input(value, ctx)
40
+ of_type.validate_input(value, ctx, max_errors: max_errors)
41
41
  end
42
42
  end
43
43
 
@@ -40,7 +40,7 @@ module GraphQL
40
40
  @default_scalar ||= false
41
41
  end
42
42
 
43
- def validate_non_null_input(value, ctx)
43
+ def validate_non_null_input(value, ctx, max_errors: nil)
44
44
  coerced_result = begin
45
45
  coerce_input(value, ctx)
46
46
  rescue GraphQL::CoercionError => err
@@ -132,7 +132,13 @@ module GraphQL
132
132
  end
133
133
 
134
134
  # @return [GraphQL::Subscriptions]
135
- attr_accessor :subscriptions
135
+ def subscriptions(inherited: true)
136
+ defined?(@subscriptions) ? @subscriptions : (inherited ? find_inherited_value(:subscriptions, nil) : nil)
137
+ end
138
+
139
+ def subscriptions=(new_implementation)
140
+ @subscriptions = new_implementation
141
+ end
136
142
 
137
143
  # Returns the JSON response of {Introspection::INTROSPECTION_QUERY}.
138
144
  # @see {#as_json}
@@ -748,13 +754,21 @@ module GraphQL
748
754
  # rubocop:disable Lint/DuplicateMethods
749
755
  module ResolveTypeWithType
750
756
  def resolve_type(type, obj, ctx)
751
- first_resolved_type, resolved_value = if type.is_a?(Module) && type.respond_to?(:resolve_type)
757
+ maybe_lazy_resolve_type_result = if type.is_a?(Module) && type.respond_to?(:resolve_type)
752
758
  type.resolve_type(obj, ctx)
753
759
  else
754
760
  super
755
761
  end
756
762
 
757
- after_lazy(first_resolved_type) do |resolved_type|
763
+ after_lazy(maybe_lazy_resolve_type_result) do |resolve_type_result|
764
+ if resolve_type_result.is_a?(Array) && resolve_type_result.size == 2
765
+ resolved_type = resolve_type_result[0]
766
+ resolved_value = resolve_type_result[1]
767
+ else
768
+ resolved_type = resolve_type_result
769
+ resolved_value = obj
770
+ end
771
+
758
772
  if resolved_type.nil? || (resolved_type.is_a?(Module) && resolved_type.respond_to?(:kind))
759
773
  if resolved_value
760
774
  [resolved_type, resolved_value]
@@ -30,10 +30,10 @@ module GraphQL
30
30
  }.tap { |h| h["path"] = path unless path.nil? }
31
31
  end
32
32
 
33
- private
34
-
35
33
  attr_reader :nodes
36
34
 
35
+ private
36
+
37
37
  def locations
38
38
  nodes.map do |node|
39
39
  h = {"line" => node.line, "column" => node.col}
@@ -9,11 +9,17 @@ module GraphQL
9
9
 
10
10
  def on_directive(node, parent)
11
11
  if !@directive_names.include?(node.name)
12
- add_error(GraphQL::StaticValidation::DirectivesAreDefinedError.new(
13
- "Directive @#{node.name} is not defined",
14
- nodes: node,
15
- directive: node.name
16
- ))
12
+ @directives_are_defined_errors_by_name ||= {}
13
+ error = @directives_are_defined_errors_by_name[node.name] ||= begin
14
+ err = GraphQL::StaticValidation::DirectivesAreDefinedError.new(
15
+ "Directive @#{node.name} is not defined",
16
+ nodes: [],
17
+ directive: node.name
18
+ )
19
+ add_error(err)
20
+ err
21
+ end
22
+ error.nodes << node
17
23
  else
18
24
  super
19
25
  end
@@ -34,12 +34,18 @@ module GraphQL
34
34
  used_directives = {}
35
35
  node.directives.each do |ast_directive|
36
36
  directive_name = ast_directive.name
37
- if used_directives[directive_name]
38
- add_error(GraphQL::StaticValidation::UniqueDirectivesPerLocationError.new(
39
- "The directive \"#{directive_name}\" can only be used once at this location.",
40
- nodes: [used_directives[directive_name], ast_directive],
41
- directive: directive_name,
42
- ))
37
+ if (first_node = used_directives[directive_name])
38
+ @directives_are_unique_errors_by_first_node ||= {}
39
+ err = @directives_are_unique_errors_by_first_node[first_node] ||= begin
40
+ error = GraphQL::StaticValidation::UniqueDirectivesPerLocationError.new(
41
+ "The directive \"#{directive_name}\" can only be used once at this location.",
42
+ nodes: [used_directives[directive_name]],
43
+ directive: directive_name,
44
+ )
45
+ add_error(error)
46
+ error
47
+ end
48
+ err.nodes << ast_directive
43
49
  elsif !((dir_defn = context.schema_directives[directive_name]) && dir_defn.repeatable?)
44
50
  used_directives[directive_name] = ast_directive
45
51
  end
@@ -26,7 +26,7 @@ module GraphQL
26
26
  def self.use(defn, options = {})
27
27
  schema = defn.is_a?(Class) ? defn : defn.target
28
28
 
29
- if schema.subscriptions
29
+ if schema.subscriptions(inherited: false)
30
30
  raise ArgumentError, "Can't reinstall subscriptions. #{schema} is using #{schema.subscriptions}, can't also add #{self}"
31
31
  end
32
32
 
@@ -62,11 +62,8 @@ module GraphQL
62
62
  # @return [void]
63
63
  def trigger(event_name, args, object, scope: nil, context: {})
64
64
  # Make something as context-like as possible, even though there isn't a current query:
65
- context = @schema.context_class.new(
66
- query: GraphQL::Query.new(@schema, "", validate: false),
67
- object: nil,
68
- values: context
69
- )
65
+ dummy_query = GraphQL::Query.new(@schema, "", validate: false, context: context)
66
+ context = dummy_query.context
70
67
  event_name = event_name.to_s
71
68
 
72
69
  # Try with the verbatim input first:
@@ -30,25 +30,19 @@ module GraphQL
30
30
  yield
31
31
  end
32
32
  when "execute_field", "execute_field_lazy"
33
- if data[:context]
34
- field = data[:context].field
35
- platform_key = field.metadata[:platform_key]
36
- trace_field = true # implemented with instrumenter
33
+ field = data[:field]
34
+ return_type = field.type.unwrap
35
+ trace_field = if return_type.kind.scalar? || return_type.kind.enum?
36
+ (field.trace.nil? && @trace_scalars) || field.trace
37
37
  else
38
- field = data[:field]
39
- return_type = field.type.unwrap
40
- trace_field = if return_type.kind.scalar? || return_type.kind.enum?
41
- (field.trace.nil? && @trace_scalars) || field.trace
42
- else
43
- true
44
- end
38
+ true
39
+ end
45
40
 
46
- platform_key = if trace_field
47
- context = data.fetch(:query).context
48
- cached_platform_key(context, field, :field) { platform_field_key(data[:owner], field) }
49
- else
50
- nil
51
- end
41
+ platform_key = if trace_field
42
+ context = data.fetch(:query).context
43
+ cached_platform_key(context, field, :field) { platform_field_key(data[:owner], field) }
44
+ else
45
+ nil
52
46
  end
53
47
 
54
48
  if platform_key && trace_field
@@ -115,6 +109,9 @@ module GraphQL
115
109
  #
116
110
  # If the key isn't present, the given block is called and the result is cached for `key`.
117
111
  #
112
+ # @param ctx [GraphQL::Query::Context]
113
+ # @param key [Class, GraphQL::Field] A part of the schema
114
+ # @param trace_phase [Symbol] The stage of execution being traced (used by OpenTelementry tracing)
118
115
  # @return [String]
119
116
  def cached_platform_key(ctx, key, trace_phase)
120
117
  cache = ctx.namespace(self.class)[:platform_key_cache] ||= {}
@@ -8,7 +8,6 @@ require "graphql/tracing/new_relic_tracing"
8
8
  require "graphql/tracing/scout_tracing"
9
9
  require "graphql/tracing/statsd_tracing"
10
10
  require "graphql/tracing/prometheus_tracing"
11
- require "graphql/tracing/opentelemetry_tracing"
12
11
 
13
12
  if defined?(PrometheusExporter::Server)
14
13
  require "graphql/tracing/prometheus_tracing/graphql_collector"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.0.9"
3
+ VERSION = "2.0.13"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-31 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -538,7 +538,6 @@ files:
538
538
  - lib/graphql/tracing/data_dog_tracing.rb
539
539
  - lib/graphql/tracing/new_relic_tracing.rb
540
540
  - lib/graphql/tracing/notifications_tracing.rb
541
- - lib/graphql/tracing/opentelemetry_tracing.rb
542
541
  - lib/graphql/tracing/platform_tracing.rb
543
542
  - lib/graphql/tracing/prometheus_tracing.rb
544
543
  - lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
@@ -596,7 +595,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
596
595
  - !ruby/object:Gem::Version
597
596
  version: '0'
598
597
  requirements: []
599
- rubygems_version: 3.2.32
598
+ rubygems_version: 3.2.22
600
599
  signing_key:
601
600
  specification_version: 4
602
601
  summary: A GraphQL language and runtime for Ruby
@@ -1,101 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Tracing
5
- class OpenTelemetryTracing < PlatformTracing
6
- self.platform_keys = {
7
- 'lex' => 'graphql.lex',
8
- 'parse' => 'graphql.parse',
9
- 'validate' => 'graphql.validate',
10
- 'analyze_query' => 'graphql.analyze_query',
11
- 'analyze_multiplex' => 'graphql.analyze_multiplex',
12
- 'execute_query' => 'graphql.execute_query',
13
- 'execute_query_lazy' => 'graphql.execute_query_lazy',
14
- 'execute_multiplex' => 'graphql.execute_multiplex'
15
- }
16
-
17
- def platform_trace(platform_key, key, data)
18
- return yield if platform_key.nil?
19
-
20
- tracer.in_span(platform_key, attributes: attributes_for(key, data)) do |span, _context|
21
- yield.tap do |response|
22
- errors = response[:errors]&.compact&.map { |e| e.to_h }&.to_json if key == 'validate'
23
- unless errors.nil?
24
- span.add_event(
25
- 'graphql.validation.error',
26
- attributes: {
27
- 'message' => errors
28
- }
29
- )
30
- end
31
- end
32
- end
33
- end
34
-
35
- def platform_field_key(type, field)
36
- "#{type.graphql_name}.#{field.graphql_name}"
37
- end
38
-
39
- def platform_authorized_key(type)
40
- "#{type.graphql_name}.authorized"
41
- end
42
-
43
- def platform_resolve_type_key(type)
44
- "#{type.graphql_name}.resolve_type"
45
- end
46
-
47
- private
48
-
49
- def tracer
50
- OpenTelemetry::Instrumentation::GraphQL::Instrumentation.instance.tracer
51
- end
52
-
53
- def config
54
- OpenTelemetry::Instrumentation::GraphQL::Instrumentation.instance.config
55
- end
56
-
57
- def platform_key_enabled?(ctx, key)
58
- return false unless config[key]
59
-
60
- ns = ctx.namespace(:opentelemetry)
61
- return true if ns.empty? # restores original behavior so that keys are returned if tracing is not set in context.
62
- return false unless ns.key?(key) && ns[key]
63
-
64
- return true
65
- end
66
-
67
- def attributes_for(key, data)
68
- attributes = {}
69
- case key
70
- when 'execute_query'
71
- attributes['selected_operation_name'] = data[:query].selected_operation_name if data[:query].selected_operation_name
72
- attributes['selected_operation_type'] = data[:query].selected_operation.operation_type
73
- attributes['query_string'] = data[:query].query_string
74
- end
75
- attributes
76
- end
77
-
78
- def cached_platform_key(ctx, key, trace_phase)
79
- cache = ctx.namespace(self.class)[:platform_key_cache] ||= {}
80
-
81
- cache.fetch(key) do
82
- cache[key] = if trace_phase == :field
83
- return unless platform_key_enabled?(ctx, :enable_platform_field)
84
-
85
- yield
86
- elsif trace_phase == :authorized
87
- return unless platform_key_enabled?(ctx, :enable_platform_authorized)
88
-
89
- yield
90
- elsif trace_phase == :resolve_type
91
- return unless platform_key_enabled?(ctx, :enable_platform_resolve_type)
92
-
93
- yield
94
- else
95
- raise "Unknown trace phase"
96
- end
97
- end
98
- end
99
- end
100
- end
101
- end