graphql 1.8.0 → 1.12.12

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.

Potentially problematic release.


This version of graphql might be problematic. Click here for more details.

Files changed (924) hide show
  1. checksums.yaml +5 -5
  2. data/lib/generators/graphql/core.rb +20 -3
  3. data/lib/generators/graphql/enum_generator.rb +3 -3
  4. data/lib/generators/graphql/install_generator.rb +52 -7
  5. data/lib/generators/graphql/loader_generator.rb +1 -0
  6. data/lib/generators/graphql/mutation_generator.rb +7 -6
  7. data/lib/generators/graphql/object_generator.rb +52 -8
  8. data/lib/generators/graphql/relay.rb +55 -0
  9. data/lib/generators/graphql/relay_generator.rb +21 -0
  10. data/lib/generators/graphql/scalar_generator.rb +20 -0
  11. data/lib/generators/graphql/templates/base_argument.erb +6 -0
  12. data/lib/generators/graphql/templates/base_connection.erb +8 -0
  13. data/lib/generators/graphql/templates/base_edge.erb +8 -0
  14. data/lib/generators/graphql/templates/base_enum.erb +6 -0
  15. data/lib/generators/graphql/templates/base_field.erb +7 -0
  16. data/lib/generators/graphql/templates/base_input_object.erb +7 -0
  17. data/lib/generators/graphql/templates/base_interface.erb +9 -0
  18. data/lib/generators/graphql/templates/base_mutation.erb +10 -0
  19. data/lib/generators/graphql/templates/base_object.erb +7 -0
  20. data/lib/generators/graphql/templates/base_scalar.erb +6 -0
  21. data/lib/generators/graphql/templates/base_union.erb +6 -0
  22. data/lib/generators/graphql/templates/enum.erb +7 -4
  23. data/lib/generators/graphql/templates/graphql_controller.erb +28 -9
  24. data/lib/generators/graphql/templates/interface.erb +8 -4
  25. data/lib/generators/graphql/templates/loader.erb +16 -12
  26. data/lib/generators/graphql/templates/mutation.erb +13 -9
  27. data/lib/generators/graphql/templates/mutation_type.erb +10 -9
  28. data/lib/generators/graphql/templates/node_type.erb +9 -0
  29. data/lib/generators/graphql/templates/object.erb +8 -5
  30. data/lib/generators/graphql/templates/query_type.erb +12 -12
  31. data/lib/generators/graphql/templates/scalar.erb +15 -0
  32. data/lib/generators/graphql/templates/schema.erb +13 -30
  33. data/lib/generators/graphql/templates/union.erb +7 -4
  34. data/lib/generators/graphql/type_generator.rb +34 -18
  35. data/lib/generators/graphql/union_generator.rb +1 -1
  36. data/lib/graphql/analysis/analyze_query.rb +18 -2
  37. data/lib/graphql/analysis/ast/analyzer.rb +84 -0
  38. data/lib/graphql/analysis/ast/field_usage.rb +28 -0
  39. data/lib/graphql/analysis/ast/max_query_complexity.rb +23 -0
  40. data/lib/graphql/analysis/ast/max_query_depth.rb +22 -0
  41. data/lib/graphql/analysis/ast/query_complexity.rb +234 -0
  42. data/lib/graphql/analysis/ast/query_depth.rb +56 -0
  43. data/lib/graphql/analysis/ast/visitor.rb +268 -0
  44. data/lib/graphql/analysis/ast.rb +91 -0
  45. data/lib/graphql/analysis/query_depth.rb +4 -17
  46. data/lib/graphql/analysis.rb +1 -0
  47. data/lib/graphql/argument.rb +40 -39
  48. data/lib/graphql/authorization.rb +82 -0
  49. data/lib/graphql/backtrace/inspect_result.rb +0 -1
  50. data/lib/graphql/backtrace/legacy_tracer.rb +56 -0
  51. data/lib/graphql/backtrace/table.rb +44 -5
  52. data/lib/graphql/backtrace/traced_error.rb +0 -1
  53. data/lib/graphql/backtrace/tracer.rb +37 -9
  54. data/lib/graphql/backtrace.rb +28 -19
  55. data/lib/graphql/backwards_compatibility.rb +3 -2
  56. data/lib/graphql/base_type.rb +9 -4
  57. data/lib/graphql/boolean_type.rb +1 -8
  58. data/lib/graphql/coercion_error.rb +8 -0
  59. data/lib/graphql/compatibility/execution_specification/specification_schema.rb +3 -4
  60. data/lib/graphql/compatibility/execution_specification.rb +1 -0
  61. data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +3 -2
  62. data/lib/graphql/compatibility/lazy_execution_specification.rb +2 -0
  63. data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +5 -9
  64. data/lib/graphql/compatibility/query_parser_specification.rb +2 -0
  65. data/lib/graphql/compatibility/schema_parser_specification.rb +443 -7
  66. data/lib/graphql/dataloader/null_dataloader.rb +22 -0
  67. data/lib/graphql/dataloader/request.rb +19 -0
  68. data/lib/graphql/dataloader/request_all.rb +19 -0
  69. data/lib/graphql/dataloader/source.rb +107 -0
  70. data/lib/graphql/dataloader.rb +252 -0
  71. data/lib/graphql/define/assign_enum_value.rb +1 -1
  72. data/lib/graphql/define/assign_global_id_field.rb +2 -2
  73. data/lib/graphql/define/assign_object_field.rb +3 -3
  74. data/lib/graphql/define/defined_object_proxy.rb +3 -0
  75. data/lib/graphql/define/instance_definable.rb +52 -110
  76. data/lib/graphql/define/type_definer.rb +5 -5
  77. data/lib/graphql/deprecated_dsl.rb +7 -2
  78. data/lib/graphql/deprecation.rb +13 -0
  79. data/lib/graphql/dig.rb +19 -0
  80. data/lib/graphql/directive/deprecated_directive.rb +1 -12
  81. data/lib/graphql/directive/include_directive.rb +1 -7
  82. data/lib/graphql/directive/skip_directive.rb +1 -8
  83. data/lib/graphql/directive.rb +21 -2
  84. data/lib/graphql/enum_type.rb +16 -71
  85. data/lib/graphql/execution/directive_checks.rb +2 -2
  86. data/lib/graphql/execution/errors.rb +162 -0
  87. data/lib/graphql/execution/execute.rb +112 -46
  88. data/lib/graphql/execution/instrumentation.rb +30 -20
  89. data/lib/graphql/execution/interpreter/argument_value.rb +28 -0
  90. data/lib/graphql/execution/interpreter/arguments.rb +88 -0
  91. data/lib/graphql/execution/interpreter/arguments_cache.rb +103 -0
  92. data/lib/graphql/execution/interpreter/execution_errors.rb +29 -0
  93. data/lib/graphql/execution/interpreter/handles_raw_value.rb +18 -0
  94. data/lib/graphql/execution/interpreter/resolve.rb +66 -0
  95. data/lib/graphql/execution/interpreter/runtime.rb +817 -0
  96. data/lib/graphql/execution/interpreter.rb +122 -0
  97. data/lib/graphql/execution/lazy/lazy_method_map.rb +4 -0
  98. data/lib/graphql/execution/lazy.rb +27 -3
  99. data/lib/graphql/execution/lookahead.rb +307 -0
  100. data/lib/graphql/execution/multiplex.rb +84 -50
  101. data/lib/graphql/execution.rb +3 -0
  102. data/lib/graphql/execution_error.rb +15 -2
  103. data/lib/graphql/field.rb +19 -123
  104. data/lib/graphql/filter.rb +1 -1
  105. data/lib/graphql/float_type.rb +1 -8
  106. data/lib/graphql/function.rb +6 -31
  107. data/lib/graphql/id_type.rb +1 -15
  108. data/lib/graphql/input_object_type.rb +12 -26
  109. data/lib/graphql/int_type.rb +1 -8
  110. data/lib/graphql/integer_decoding_error.rb +17 -0
  111. data/lib/graphql/integer_encoding_error.rb +20 -0
  112. data/lib/graphql/interface_type.rb +26 -22
  113. data/lib/graphql/internal_representation/document.rb +2 -2
  114. data/lib/graphql/internal_representation/rewrite.rb +127 -142
  115. data/lib/graphql/internal_representation/scope.rb +2 -2
  116. data/lib/graphql/internal_representation/visit.rb +3 -2
  117. data/lib/graphql/introspection/base_object.rb +2 -5
  118. data/lib/graphql/introspection/directive_type.rb +8 -4
  119. data/lib/graphql/introspection/dynamic_fields.rb +9 -3
  120. data/lib/graphql/introspection/entry_points.rb +15 -9
  121. data/lib/graphql/introspection/enum_value_type.rb +4 -0
  122. data/lib/graphql/introspection/field_type.rb +7 -3
  123. data/lib/graphql/introspection/input_value_type.rb +33 -5
  124. data/lib/graphql/introspection/introspection_query.rb +6 -92
  125. data/lib/graphql/introspection/schema_type.rb +6 -5
  126. data/lib/graphql/introspection/type_type.rb +14 -7
  127. data/lib/graphql/introspection.rb +96 -3
  128. data/lib/graphql/invalid_null_error.rb +19 -1
  129. data/lib/graphql/language/block_string.rb +63 -7
  130. data/lib/graphql/language/cache.rb +37 -0
  131. data/lib/graphql/language/definition_slice.rb +21 -10
  132. data/lib/graphql/language/document_from_schema_definition.rb +136 -71
  133. data/lib/graphql/language/lexer.rb +215 -153
  134. data/lib/graphql/language/lexer.rl +86 -53
  135. data/lib/graphql/language/nodes.rb +456 -301
  136. data/lib/graphql/language/parser.rb +1109 -861
  137. data/lib/graphql/language/parser.y +177 -98
  138. data/lib/graphql/language/printer.rb +4 -4
  139. data/lib/graphql/language/sanitized_printer.rb +222 -0
  140. data/lib/graphql/language/token.rb +6 -2
  141. data/lib/graphql/language/visitor.rb +168 -16
  142. data/lib/graphql/language.rb +3 -2
  143. data/lib/graphql/list_type.rb +1 -0
  144. data/lib/graphql/load_application_object_failed_error.rb +22 -0
  145. data/lib/graphql/name_validator.rb +6 -7
  146. data/lib/graphql/non_null_type.rb +1 -10
  147. data/lib/graphql/object_type.rb +52 -59
  148. data/lib/graphql/pagination/active_record_relation_connection.rb +48 -0
  149. data/lib/graphql/pagination/array_connection.rb +77 -0
  150. data/lib/graphql/pagination/connection.rb +226 -0
  151. data/lib/graphql/pagination/connections.rb +136 -0
  152. data/lib/graphql/pagination/mongoid_relation_connection.rb +25 -0
  153. data/lib/graphql/pagination/relation_connection.rb +196 -0
  154. data/lib/graphql/pagination/sequel_dataset_connection.rb +28 -0
  155. data/lib/graphql/pagination.rb +6 -0
  156. data/lib/graphql/parse_error.rb +0 -1
  157. data/lib/graphql/query/arguments.rb +33 -20
  158. data/lib/graphql/query/arguments_cache.rb +1 -2
  159. data/lib/graphql/query/context.rb +92 -23
  160. data/lib/graphql/query/executor.rb +1 -2
  161. data/lib/graphql/query/fingerprint.rb +26 -0
  162. data/lib/graphql/query/input_validation_result.rb +23 -6
  163. data/lib/graphql/query/literal_input.rb +30 -9
  164. data/lib/graphql/query/null_context.rb +18 -3
  165. data/lib/graphql/query/result.rb +1 -1
  166. data/lib/graphql/query/serial_execution.rb +1 -0
  167. data/lib/graphql/query/validation_pipeline.rb +45 -26
  168. data/lib/graphql/query/variable_validation_error.rb +25 -2
  169. data/lib/graphql/query/variables.rb +33 -27
  170. data/lib/graphql/query.rb +119 -29
  171. data/lib/graphql/railtie.rb +15 -7
  172. data/lib/graphql/rake_task/validate.rb +4 -1
  173. data/lib/graphql/rake_task.rb +12 -9
  174. data/lib/graphql/relay/array_connection.rb +11 -13
  175. data/lib/graphql/relay/base_connection.rb +33 -14
  176. data/lib/graphql/relay/connection_instrumentation.rb +24 -18
  177. data/lib/graphql/relay/connection_resolve.rb +7 -27
  178. data/lib/graphql/relay/connection_type.rb +4 -2
  179. data/lib/graphql/relay/edge_type.rb +2 -0
  180. data/lib/graphql/relay/edges_instrumentation.rb +9 -25
  181. data/lib/graphql/relay/mongo_relation_connection.rb +10 -0
  182. data/lib/graphql/relay/mutation/instrumentation.rb +1 -2
  183. data/lib/graphql/relay/mutation/resolve.rb +2 -4
  184. data/lib/graphql/relay/mutation.rb +4 -87
  185. data/lib/graphql/relay/node.rb +8 -36
  186. data/lib/graphql/relay/page_info.rb +1 -9
  187. data/lib/graphql/relay/range_add.rb +23 -9
  188. data/lib/graphql/relay/relation_connection.rb +18 -16
  189. data/lib/graphql/relay/type_extensions.rb +2 -0
  190. data/lib/graphql/relay.rb +0 -1
  191. data/lib/graphql/scalar_type.rb +17 -61
  192. data/lib/graphql/schema/addition.rb +238 -0
  193. data/lib/graphql/schema/argument.rb +263 -15
  194. data/lib/graphql/schema/base_64_bp.rb +26 -0
  195. data/lib/graphql/schema/base_64_encoder.rb +10 -4
  196. data/lib/graphql/schema/build_from_definition/resolve_map/default_resolve.rb +1 -1
  197. data/lib/graphql/schema/build_from_definition/resolve_map.rb +13 -5
  198. data/lib/graphql/schema/build_from_definition.rb +317 -206
  199. data/lib/graphql/schema/built_in_types.rb +12 -0
  200. data/lib/graphql/schema/default_type_error.rb +3 -1
  201. data/lib/graphql/schema/directive/deprecated.rb +18 -0
  202. data/lib/graphql/schema/directive/feature.rb +66 -0
  203. data/lib/graphql/schema/directive/flagged.rb +57 -0
  204. data/lib/graphql/schema/directive/include.rb +25 -0
  205. data/lib/graphql/schema/directive/skip.rb +25 -0
  206. data/lib/graphql/schema/directive/transform.rb +60 -0
  207. data/lib/graphql/schema/directive.rb +210 -0
  208. data/lib/graphql/schema/enum.rb +55 -4
  209. data/lib/graphql/schema/enum_value.rb +24 -5
  210. data/lib/graphql/schema/field/connection_extension.rb +76 -0
  211. data/lib/graphql/schema/field/scope_extension.rb +22 -0
  212. data/lib/graphql/schema/field.rb +548 -125
  213. data/lib/graphql/schema/field_extension.rb +69 -0
  214. data/lib/graphql/schema/find_inherited_value.rb +35 -0
  215. data/lib/graphql/schema/finder.rb +13 -11
  216. data/lib/graphql/schema/input_object.rb +190 -17
  217. data/lib/graphql/schema/interface.rb +49 -7
  218. data/lib/graphql/schema/introspection_system.rb +112 -36
  219. data/lib/graphql/schema/late_bound_type.rb +3 -2
  220. data/lib/graphql/schema/list.rb +55 -12
  221. data/lib/graphql/schema/loader.rb +164 -111
  222. data/lib/graphql/schema/member/base_dsl_methods.rb +59 -30
  223. data/lib/graphql/schema/member/build_type.rb +60 -14
  224. data/lib/graphql/schema/member/cached_graphql_definition.rb +5 -0
  225. data/lib/graphql/schema/member/has_arguments.rb +198 -4
  226. data/lib/graphql/schema/member/has_ast_node.rb +20 -0
  227. data/lib/graphql/schema/member/has_deprecation_reason.rb +25 -0
  228. data/lib/graphql/schema/member/has_directives.rb +98 -0
  229. data/lib/graphql/schema/member/has_fields.rb +51 -76
  230. data/lib/graphql/schema/member/has_path.rb +25 -0
  231. data/lib/graphql/schema/member/has_unresolved_type_error.rb +15 -0
  232. data/lib/graphql/schema/member/has_validators.rb +31 -0
  233. data/lib/graphql/schema/member/instrumentation.rb +42 -26
  234. data/lib/graphql/schema/member/relay_shortcuts.rb +47 -0
  235. data/lib/graphql/schema/member/scoped.rb +21 -0
  236. data/lib/graphql/schema/member/type_system_helpers.rb +7 -3
  237. data/lib/graphql/schema/member/validates_input.rb +33 -0
  238. data/lib/graphql/schema/member.rb +20 -4
  239. data/lib/graphql/schema/middleware_chain.rb +1 -1
  240. data/lib/graphql/schema/mutation.rb +13 -57
  241. data/lib/graphql/schema/non_null.rb +40 -11
  242. data/lib/graphql/schema/object.rb +145 -9
  243. data/lib/graphql/schema/possible_types.rb +14 -7
  244. data/lib/graphql/schema/printer.rb +7 -19
  245. data/lib/graphql/schema/relay_classic_mutation.rb +56 -9
  246. data/lib/graphql/schema/rescue_middleware.rb +7 -2
  247. data/lib/graphql/schema/resolver/has_payload_type.rb +71 -0
  248. data/lib/graphql/schema/resolver.rb +297 -6
  249. data/lib/graphql/schema/scalar.rb +37 -3
  250. data/lib/graphql/schema/subscription.rb +127 -0
  251. data/lib/graphql/schema/timeout.rb +123 -0
  252. data/lib/graphql/schema/timeout_middleware.rb +7 -4
  253. data/lib/graphql/schema/traversal.rb +14 -3
  254. data/lib/graphql/schema/type_expression.rb +21 -13
  255. data/lib/graphql/schema/type_membership.rb +34 -0
  256. data/lib/graphql/schema/union.rb +60 -6
  257. data/lib/graphql/schema/unique_within_type.rb +3 -1
  258. data/lib/graphql/schema/validation.rb +40 -13
  259. data/lib/graphql/schema/validator/exclusion_validator.rb +31 -0
  260. data/lib/graphql/schema/validator/format_validator.rb +49 -0
  261. data/lib/graphql/schema/validator/inclusion_validator.rb +33 -0
  262. data/lib/graphql/schema/validator/length_validator.rb +57 -0
  263. data/lib/graphql/schema/validator/numericality_validator.rb +71 -0
  264. data/lib/graphql/schema/validator/required_validator.rb +68 -0
  265. data/lib/graphql/schema/validator.rb +163 -0
  266. data/lib/graphql/schema/warden.rb +192 -25
  267. data/lib/graphql/schema/wrapper.rb +29 -0
  268. data/lib/graphql/schema.rb +1078 -205
  269. data/lib/graphql/static_validation/all_rules.rb +5 -2
  270. data/lib/graphql/static_validation/base_visitor.rb +214 -0
  271. data/lib/graphql/static_validation/default_visitor.rb +15 -0
  272. data/lib/graphql/static_validation/definition_dependencies.rb +74 -71
  273. data/lib/graphql/static_validation/error.rb +44 -0
  274. data/lib/graphql/static_validation/interpreter_visitor.rb +14 -0
  275. data/lib/graphql/static_validation/literal_validator.rb +87 -19
  276. data/lib/graphql/static_validation/no_validate_visitor.rb +10 -0
  277. data/lib/graphql/static_validation/rules/argument_literals_are_compatible.rb +55 -17
  278. data/lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb +48 -0
  279. data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +31 -0
  280. data/lib/graphql/static_validation/rules/argument_names_are_unique_error.rb +30 -0
  281. data/lib/graphql/static_validation/rules/arguments_are_defined.rb +61 -8
  282. data/lib/graphql/static_validation/rules/arguments_are_defined_error.rb +37 -0
  283. data/lib/graphql/static_validation/rules/directives_are_defined.rb +12 -15
  284. data/lib/graphql/static_validation/rules/directives_are_defined_error.rb +29 -0
  285. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +19 -14
  286. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations_error.rb +31 -0
  287. data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +18 -20
  288. data/lib/graphql/static_validation/rules/fields_are_defined_on_type_error.rb +32 -0
  289. data/lib/graphql/static_validation/rules/fields_have_appropriate_selections.rb +33 -17
  290. data/lib/graphql/static_validation/rules/fields_have_appropriate_selections_error.rb +31 -0
  291. data/lib/graphql/static_validation/rules/fields_will_merge.rb +381 -30
  292. data/lib/graphql/static_validation/rules/fields_will_merge_error.rb +32 -0
  293. data/lib/graphql/static_validation/rules/fragment_names_are_unique.rb +20 -13
  294. data/lib/graphql/static_validation/rules/fragment_names_are_unique_error.rb +29 -0
  295. data/lib/graphql/static_validation/rules/fragment_spreads_are_possible.rb +37 -29
  296. data/lib/graphql/static_validation/rules/fragment_spreads_are_possible_error.rb +35 -0
  297. data/lib/graphql/static_validation/rules/fragment_types_exist.rb +25 -17
  298. data/lib/graphql/static_validation/rules/fragment_types_exist_error.rb +29 -0
  299. data/lib/graphql/static_validation/rules/fragments_are_finite.rb +12 -10
  300. data/lib/graphql/static_validation/rules/fragments_are_finite_error.rb +29 -0
  301. data/lib/graphql/static_validation/rules/fragments_are_named.rb +7 -11
  302. data/lib/graphql/static_validation/rules/fragments_are_named_error.rb +26 -0
  303. data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +16 -16
  304. data/lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb +30 -0
  305. data/lib/graphql/static_validation/rules/fragments_are_used.rb +21 -14
  306. data/lib/graphql/static_validation/rules/fragments_are_used_error.rb +29 -0
  307. data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +30 -0
  308. data/lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb +30 -0
  309. data/lib/graphql/static_validation/rules/mutation_root_exists.rb +10 -14
  310. data/lib/graphql/static_validation/rules/mutation_root_exists_error.rb +26 -0
  311. data/lib/graphql/static_validation/rules/no_definitions_are_present.rb +31 -22
  312. data/lib/graphql/static_validation/rules/no_definitions_are_present_error.rb +25 -0
  313. data/lib/graphql/static_validation/rules/operation_names_are_valid.rb +25 -17
  314. data/lib/graphql/static_validation/rules/operation_names_are_valid_error.rb +28 -0
  315. data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +19 -20
  316. data/lib/graphql/static_validation/rules/required_arguments_are_present_error.rb +35 -0
  317. data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +59 -0
  318. data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb +35 -0
  319. data/lib/graphql/static_validation/rules/subscription_root_exists.rb +10 -14
  320. data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +26 -0
  321. data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +28 -17
  322. data/lib/graphql/static_validation/rules/unique_directives_per_location_error.rb +29 -0
  323. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +35 -19
  324. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed_error.rb +39 -0
  325. data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +15 -14
  326. data/lib/graphql/static_validation/rules/variable_names_are_unique_error.rb +29 -0
  327. data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +46 -36
  328. data/lib/graphql/static_validation/rules/variable_usages_are_allowed_error.rb +38 -0
  329. data/lib/graphql/static_validation/rules/variables_are_input_types.rb +18 -14
  330. data/lib/graphql/static_validation/rules/variables_are_input_types_error.rb +32 -0
  331. data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +76 -66
  332. data/lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb +37 -0
  333. data/lib/graphql/static_validation/type_stack.rb +2 -2
  334. data/lib/graphql/static_validation/validation_context.rb +9 -54
  335. data/lib/graphql/static_validation/validation_timeout_error.rb +25 -0
  336. data/lib/graphql/static_validation/validator.rb +56 -16
  337. data/lib/graphql/static_validation.rb +6 -3
  338. data/lib/graphql/string_type.rb +1 -17
  339. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +116 -24
  340. data/lib/graphql/subscriptions/broadcast_analyzer.rb +81 -0
  341. data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +21 -0
  342. data/lib/graphql/subscriptions/event.rb +62 -8
  343. data/lib/graphql/subscriptions/instrumentation.rb +12 -5
  344. data/lib/graphql/subscriptions/serialize.rb +33 -6
  345. data/lib/graphql/subscriptions/subscription_root.rb +76 -0
  346. data/lib/graphql/subscriptions.rb +119 -35
  347. data/lib/graphql/tracing/active_support_notifications_tracing.rb +16 -12
  348. data/lib/graphql/tracing/appoptics_tracing.rb +173 -0
  349. data/lib/graphql/tracing/appsignal_tracing.rb +9 -1
  350. data/lib/graphql/tracing/data_dog_tracing.rb +28 -1
  351. data/lib/graphql/tracing/new_relic_tracing.rb +12 -15
  352. data/lib/graphql/tracing/platform_tracing.rb +70 -3
  353. data/lib/graphql/tracing/prometheus_tracing/graphql_collector.rb +32 -0
  354. data/lib/graphql/tracing/prometheus_tracing.rb +67 -0
  355. data/lib/graphql/tracing/scout_tracing.rb +20 -1
  356. data/lib/graphql/tracing/skylight_tracing.rb +33 -2
  357. data/lib/graphql/tracing/statsd_tracing.rb +42 -0
  358. data/lib/graphql/tracing.rb +26 -41
  359. data/lib/graphql/type_kinds.rb +41 -14
  360. data/lib/graphql/types/big_int.rb +19 -0
  361. data/lib/graphql/types/boolean.rb +18 -0
  362. data/lib/graphql/types/float.rb +19 -0
  363. data/lib/graphql/types/id.rb +24 -0
  364. data/lib/graphql/types/int.rb +36 -0
  365. data/lib/graphql/types/iso_8601_date.rb +34 -0
  366. data/lib/graphql/types/iso_8601_date_time.rb +65 -0
  367. data/lib/graphql/types/json.rb +25 -0
  368. data/lib/graphql/types/relay/base_connection.rb +39 -0
  369. data/lib/graphql/types/relay/base_edge.rb +29 -0
  370. data/lib/graphql/types/relay/connection_behaviors.rb +156 -0
  371. data/lib/graphql/types/relay/default_relay.rb +27 -0
  372. data/lib/graphql/types/relay/edge_behaviors.rb +53 -0
  373. data/lib/graphql/types/relay/has_node_field.rb +41 -0
  374. data/lib/graphql/types/relay/has_nodes_field.rb +41 -0
  375. data/lib/graphql/types/relay/node.rb +15 -0
  376. data/lib/graphql/types/relay/node_behaviors.rb +15 -0
  377. data/lib/graphql/types/relay/node_field.rb +25 -0
  378. data/lib/graphql/types/relay/nodes_field.rb +27 -0
  379. data/lib/graphql/types/relay/page_info.rb +11 -0
  380. data/lib/graphql/types/relay/page_info_behaviors.rb +25 -0
  381. data/lib/graphql/types/relay.rb +41 -0
  382. data/lib/graphql/types/string.rb +29 -0
  383. data/lib/graphql/types.rb +11 -0
  384. data/lib/graphql/unauthorized_error.rb +29 -0
  385. data/lib/graphql/unauthorized_field_error.rb +23 -0
  386. data/lib/graphql/union_type.rb +78 -45
  387. data/lib/graphql/unresolved_type_error.rb +2 -2
  388. data/lib/graphql/upgrader/member.rb +157 -114
  389. data/lib/graphql/upgrader/schema.rb +1 -0
  390. data/lib/graphql/version.rb +1 -1
  391. data/lib/graphql.rb +108 -20
  392. data/readme.md +8 -8
  393. metadata +213 -1157
  394. data/lib/generators/graphql/function_generator.rb +0 -18
  395. data/lib/generators/graphql/templates/function.erb +0 -17
  396. data/lib/graphql/introspection/schema_field.rb +0 -16
  397. data/lib/graphql/introspection/type_by_name_field.rb +0 -22
  398. data/lib/graphql/introspection/typename_field.rb +0 -12
  399. data/lib/graphql/language/comments.rb +0 -45
  400. data/lib/graphql/static_validation/arguments_validator.rb +0 -50
  401. data/lib/graphql/static_validation/message.rb +0 -40
  402. data/spec/dummy/Gemfile +0 -12
  403. data/spec/dummy/Gemfile.lock +0 -149
  404. data/spec/dummy/README.md +0 -24
  405. data/spec/dummy/Rakefile +0 -7
  406. data/spec/dummy/app/assets/config/manifest.js +0 -1
  407. data/spec/dummy/app/assets/javascripts/application.js +0 -66
  408. data/spec/dummy/app/channels/application_cable/channel.rb +0 -5
  409. data/spec/dummy/app/channels/application_cable/connection.rb +0 -5
  410. data/spec/dummy/app/channels/graphql_channel.rb +0 -105
  411. data/spec/dummy/app/controllers/application_controller.rb +0 -4
  412. data/spec/dummy/app/controllers/pages_controller.rb +0 -5
  413. data/spec/dummy/app/helpers/application_helper.rb +0 -3
  414. data/spec/dummy/app/jobs/application_job.rb +0 -3
  415. data/spec/dummy/app/views/layouts/application.html.erb +0 -12
  416. data/spec/dummy/app/views/pages/show.html +0 -16
  417. data/spec/dummy/bin/bundle +0 -4
  418. data/spec/dummy/bin/rails +0 -5
  419. data/spec/dummy/bin/rake +0 -5
  420. data/spec/dummy/bin/setup +0 -31
  421. data/spec/dummy/bin/update +0 -27
  422. data/spec/dummy/bin/yarn +0 -12
  423. data/spec/dummy/config/application.rb +0 -30
  424. data/spec/dummy/config/boot.rb +0 -4
  425. data/spec/dummy/config/cable.yml +0 -10
  426. data/spec/dummy/config/environment.rb +0 -6
  427. data/spec/dummy/config/environments/development.rb +0 -40
  428. data/spec/dummy/config/environments/production.rb +0 -76
  429. data/spec/dummy/config/environments/test.rb +0 -37
  430. data/spec/dummy/config/initializers/application_controller_renderer.rb +0 -9
  431. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -8
  432. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -6
  433. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -5
  434. data/spec/dummy/config/initializers/inflections.rb +0 -17
  435. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  436. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -10
  437. data/spec/dummy/config/locales/en.yml +0 -33
  438. data/spec/dummy/config/puma.rb +0 -57
  439. data/spec/dummy/config/routes.rb +0 -4
  440. data/spec/dummy/config/secrets.yml +0 -32
  441. data/spec/dummy/config.ru +0 -6
  442. data/spec/dummy/log/development.log +0 -599
  443. data/spec/dummy/log/test.log +0 -1220
  444. data/spec/dummy/package.json +0 -5
  445. data/spec/dummy/public/404.html +0 -67
  446. data/spec/dummy/public/422.html +0 -67
  447. data/spec/dummy/public/500.html +0 -66
  448. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  449. data/spec/dummy/public/apple-touch-icon.png +0 -0
  450. data/spec/dummy/public/favicon.ico +0 -0
  451. data/spec/dummy/public/robots.txt +0 -1
  452. data/spec/dummy/test/application_system_test_case.rb +0 -6
  453. data/spec/dummy/test/system/action_cable_subscription_test.rb +0 -45
  454. data/spec/dummy/test/test_helper.rb +0 -3
  455. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-5/-5OWGoO21F6_WNuECrXgkwH7NcKlWSSe2GjVanwsmUk.cache +0 -0
  456. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-T/-TNJ0-j8HjZCYUE7EDQlhfGu64B8guOUPkXYO6HFhus.cache +0 -0
  457. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-x/-xYZjAnuuzgR79fcznLTQtSdh6AARxu8FcQ_J6p7L3U.cache +0 -0
  458. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/09/09tM9-9HC9J7np7PawoxLz0YZYB_jmwdMFL4N4WBJdM.cache +0 -1
  459. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0H/0HR_baZ3Owzw1Gx5epPCDhsl0UXWGh73zDkQu08IHuc.cache +0 -1
  460. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/13/13HiV12xyoQvT-1L39ZzLwMZxjyaGMiENmfw7f-QTIc.cache +0 -0
  461. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1I/1IbYhe7oTUZvWCe0pIMBMp5bLq5pCuxuxlgnQV1TAno.cache +0 -2
  462. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1I/1i4n3ptJre3b2zbA9AvgzE-ThTU_1mqSX3AlMtS_Qxk.cache +0 -1
  463. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1L/1LQJg_vkfK3o2UCvJGQKuGjXydCfw7GerrpJCGiKw5k.cache +0 -1
  464. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1U/1U5446rsEAdkd13irJZX_XQoEKv9Ay8wSrKES_-gD8k.cache +0 -0
  465. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2c/2cKLFtRkYbS9lni4MJ8unG2jW0YmNgK6tdelamzjM30.cache +0 -0
  466. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2m/2mGtEm87jDbeppJBYdnCWjRDV5cQaosG-bKVwVN7_kE.cache +0 -1
  467. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2p/2pt2peFCVR6OoIrgufIQbrDGMcFLYwrJtHsLENF31jQ.cache +0 -0
  468. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2u/2uWP73mE8FRywvUKKT08RhFuNUlVUEopIKdt0Jtt8y8.cache +0 -1
  469. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3-/3-C6wEhMG8qKt4rLfzJzMlRBgxb5aDJIB2m5WS0WbAI.cache +0 -0
  470. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/33/33_yR0KysvUnUWvR5TzwELDqGApTbi2ex2o3vY-ybfU.cache +0 -1
  471. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3N/3NTAQ9mVEZbccGibE39JpeqlDw2L6zcUtlRsbPCT918.cache +0 -2
  472. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3V/3V8ZntS_gc1fums5LuLZK0a_nwPIjLXSD0JNF_3ScEk.cache +0 -0
  473. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3W/3Wtf5pCWdqq0AB-iB0Y9uUNrTkruRxIEf1XFn_BETU0.cache +0 -1
  474. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4U/4UAd9Le8LhEYS8mCovy_yQC_ofpTBWt1Q997x0hg6xY.cache +0 -0
  475. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4V/4VaOsvficwh2EmmuR-pEJTISpR9mbr8Cf7jYYyptEwY.cache +0 -2
  476. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/53/53WajXFPOCZVqMrL7nxYAYl90fSweya9XM4vrDJhU6c.cache +0 -1
  477. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/53/53oHiwCXSKokJPEWS6w53bGXkeZm-YAcDuXcBhNscEY.cache +0 -0
  478. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5Q/5QrnrmEh-kADCXW4bexyNOrjfDmlq_YHgPcEYcHtz28.cache +0 -0
  479. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5T/5ThW8FwEh4SPqrxD1RKHSc3o-vA_2ff5zKoly--6uuM.cache +0 -0
  480. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5d/5dGYuqW7Lp3oCc1lq8B9Uoa0lfgE4iOEiGvgwRf1JHA.cache +0 -0
  481. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5f/5fUAiOa1Zm-ove4HOeSLN1OQmEMHu0OYjHrYIK3-SGE.cache +0 -2
  482. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5f/5flfgUDFCRhrUbGifk2RfSEGWOBMubAcaWg4ZadI5PY.cache +0 -1
  483. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5i/5iW33HH6azj0ds2lqDaOB1666CY_uOHhVAQavgh7tYw.cache +0 -1
  484. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5i/5iguGafb4hOn8262Kn8Q37ogNN9MxxQKGKNzHAzUcvI.cache +0 -1
  485. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5m/5m0G50I6WuIDftOEFtJHjC0KmN1mnhe51wBZ2dq9la0.cache +0 -0
  486. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5m/5mzbQNNLQ1vmll1Azo5cAZpDY2Zc7C_CLYJH2zKtzYY.cache +0 -0
  487. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6K/6KeDYkyM_nd3JJSp2B4HtcpdeA3uHgJLSlRaEVpH328.cache +0 -1
  488. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6V/6Vgv7g9Uc08fiIpuLxlhqPTfx6tGo1yLedmmUvEL41A.cache +0 -2
  489. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6n/6nd7P_DUqcusZX7UkA5TILZyMrcu-AYfxnc2Kz_J0qQ.cache +0 -1
  490. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/6x/6x8om3H3i1stGMEt1wnZ3OsVPGj-sxwE-eyd7A6hSi8.cache +0 -0
  491. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/70/7037jorQaO3wUpzYOJoDOd8cgJMeC2uTysojXmeaYzs.cache +0 -0
  492. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7p/7pN8wYS-6xc_x5BzT4gRgFAiVGhhcW9NHg_e6Ng5CDw.cache +0 -0
  493. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7r/7rgR5Gy_i08FxXwdCvtqSCXSghB7e5EXB2Vox4MQVUg.cache +0 -2
  494. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8Q/8Qz_ptqTPNDlaE2aAVgaFiIBByiF2fhNHKQJFggzJYA.cache +0 -0
  495. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8e/8ezXMOIySx7oyopI2nH1EXfCzPCFHTJiS3q2tvyEZjY.cache +0 -1
  496. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8m/8mj2T6yy847Mc2Z7k3Xzh8O91hhVJt3NrPe8ASNDlIA.cache +0 -1
  497. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8w/8wY_SKagj8wHuwGNAAf6JnQ8joMbC6cEYpHrTAI8Urc.cache +0 -1
  498. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/99/99m8UCKl4j8IpsVOK8ltLHyNh8Ae0nHw3GBkC34V_co.cache +0 -0
  499. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9a/9abVi8XfoB8pGShaL5_-jzZGJIxKmedpFY0HQ5h24oE.cache +0 -1
  500. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9g/9gsAnrIrurboVInpkI-XlUZdUGmshgVKXpdRCtXUt6U.cache +0 -2
  501. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9l/9lUXwCLUk9jTC-3kZdXDSRo-klgJVL54qVOIQmKxlyo.cache +0 -1
  502. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/9z/9zFndwRgSOtYlsafWZK_zfCvnqMF4Vv9IqkVxn0gUbM.cache +0 -1
  503. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/A2/A2LHSq1LhqpUvGzPhj15d7c1Sj2RkYyajxf8ipO1x0A.cache +0 -1
  504. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/AO/AOgGJjES3shgkGKKaEb6GMfcfUm18alfRVbYsMJKFyc.cache +0 -0
  505. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ag/AgIFaB92zNMX4-Gy1uYelrx1pnszMI9CxP0aO62ismQ.cache +0 -1
  506. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ag/agBYa9WG7ZT869eaOCVQ4mfpe9AWU8oNjU0g9foJZxk.cache +0 -1
  507. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/B4/B43LeT9Wba4fLvXw-C_kKq-x9HwYZxnBBiltbIufzzQ.cache +0 -0
  508. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/B4/b4w856SSmGPJvZoawjQ63nUN1himU_z41nfZQNGvdag.cache +0 -0
  509. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bg/BgLjB8mXnvRh9DrKcGI_KblFPuA84hjh4nJC50FDsWc.cache +0 -2
  510. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bw/Bwb0DDjQm45Eqy64G2YHrm2eOj1PkqG51Hh3MWG0V40.cache +0 -1
  511. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/C4/C4hGtajZFD6B_bt3ow2qxPGLb1ycjE_7G8Ssi2q5HuA.cache +0 -1
  512. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CA/CAI82me2PN_gR-kiw8xQDx9FQBiLj_cyO4HVfZfiqf8.cache +0 -0
  513. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CR/CR85EGUmeGMQQR96qjUurW5HSk4vr5JgWDLQEFxhnAY.cache +0 -1
  514. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cn/CniRwlPjVCW9FLyHc9oNHIvE-TdlvyAP-lAOrkSBsQg.cache +0 -1
  515. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D1/D1ZVypz4A_qF0cewMs2YiW5uWi7MKEdPOoOXeBQKeL0.cache +0 -1
  516. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D4/D4osajB0M3Tk4bo3qAkcpkXlGHReFCOJxlo20Deiqk4.cache +0 -0
  517. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/D9/D9cZjx3n4E4qKXoR9rROjaYWpm1nnip45O0Ubyqyho8.cache +0 -0
  518. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DP/DPvPPYoq_7HYVvKapcWxWL0bSIyINU7Oc93He65SrAk.cache +0 -1
  519. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/DT/DTQyMpr4ABZYQetsdRJ5A7S4jf1r3ie4FGOR7GZBNSs.cache +0 -3
  520. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Df/Dfl0fgtV2z9SkiRUCnFBU6pD3TPmL0rI_lUqOVSglz8.cache +0 -0
  521. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Df/dfOhvqqzI4Yxr6VUUn6T5DARFk5SNeEasmpVaiBivxQ.cache +0 -1
  522. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dl/DlaCy1X82C9F58mF2UUes54AZzBUIGyuFiZEc9PUW0U.cache +0 -1
  523. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dq/DqJ5_yJPrP5iLlOQyTQsjAVI5FE5LCVDkED0f7GgsSo.cache +0 -3
  524. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dy/DyHdMGh9NYCQ6KM4Cs6ySrmxIGQLcs3urJo2ni_GHeI.cache +0 -0
  525. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/E8/E84Qt1hM8br74RgXrkdGt8CGM8KnVROweUTPah6hpao.cache +0 -0
  526. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ea/Ea7ca7cxAj6u9A8UKN2ZVtAFE3GXgmTZtHiorPaUnTg.cache +0 -1
  527. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F8/F8MUNRzORGFgr329fNM0xLaoWCXdv3BIalT7dsvLfjs.cache +0 -0
  528. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FN/FNAoxlHjPOpzywpYUXo13-PLULLhE4lZ8jRmsdCpQ8s.cache +0 -2
  529. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FS/FS-IBIwKNJB6ey4YiEJy3WQxdihlzqhn27zuXCPW3I4.cache +0 -0
  530. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FS/fsx-7r5CnuEuuruO05WoCqUE7I7yHdsHFyufpAo9L_w.cache +0 -2
  531. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FU/FU7chcPDGpikN_If4SNgCUiwKbAtWa-dV0x644C-R8A.cache +0 -0
  532. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/FZ/FZS5A8sTziH2yLSQsehYe2Lov6tTh7qddnYpUCOrSg8.cache +0 -0
  533. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/F_/F_wHSssqVgbtl2xnKiCAx8T1yXJcm6G6FFYyEQOM1vk.cache +0 -1
  534. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Gx/GxO9oxH-DZ8Vk1eqP17OKFSocWisT4gGJtcGM1t5Fio.cache +0 -2
  535. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/H6/H6QLQGIr0MZMFEBwWkJpjKCoSmnCM1d1b7Z2bT1pchI.cache +0 -0
  536. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HC/HCDOUd7-S45aJ_PjVAC_Vmjyud3i1aQv4cE3t9_Z3Dw.cache +0 -2
  537. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HN/HNBghWjxKPnFYO5L6fJf8R4AeZ0rdAOL6sUFWovnBwU.cache +0 -1
  538. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hb/HbX5bR5UYD1vbffHD_0rvCrL9QARJ6bCpD00MQdR1g4.cache +0 -1
  539. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Hm/HmOkSBI1TuhJ1te9t-y9GHxMWn2FVl-RnFS8oWi7V_w.cache +0 -1
  540. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/IN/INJypnigTMfqqPOcC-b9F0Iye_HbwItx-5XDHLUtWDc.cache +0 -1
  541. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ig/IgW_xNyC9axLdFbnQLpkLYqhAzSgmdACo0mT8ai455Y.cache +0 -1
  542. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JY/JYy-al-c4ButCglqQfY9a5PZV6XFNBjtHD9sWas7NbE.cache +0 -1
  543. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ja/Jah1OygWPoT6OkBv-5VE19u3b0vGJTHsGse68OBZmtQ.cache +0 -2
  544. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/K0/K0-nXg3QbjeMtvvRvPXZiL0kCh0YtyApX9XrJrj95Po.cache +0 -0
  545. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/KB/KB07ZaKNC5uXJ7TjLi-WqnY6g7dq8wWp_8N3HNjBNxg.cache +0 -3
  546. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/KI/KIVgv3yfi4fSugBTELntGMTgpB8JKD1c5_CxdEvkfaw.cache +0 -1
  547. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/KO/KOgbmY0o5uemlVX1FmoTnTDK6QDnydWoRF2Ht9TtN2U.cache +0 -1
  548. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/LI/LIHDRdjIBdKfW4tnKTESwsWFz4OeCV-sJZtEKUYaLiU.cache +0 -1
  549. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/La/LavB01ePIpCqyhy1AJu1V9piCEAYuTyS5bjdSEVqEoY.cache +0 -1
  550. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lx/Lx6tpPxpS0hrFKiVXiv37Q4bFJjhDJJak7WUoOemLC8.cache +0 -0
  551. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Lx/LxRPPEO9CB_ckDd1jRPcKJjsm_Gc0CGMSmrdUXXpzjs.cache +0 -2
  552. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/M6/M6hnb_EIRICxNcrNSkV7ekfCpVo0O9U2XSSaLxDqONI.cache +0 -1
  553. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Mq/MqwfYiRcCBhwwS_cH5IyKUMsvSreSqmpD_WV3AHeZcw.cache +0 -0
  554. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/N-/N-bT7IhQ1pVoh_gTwxXqeK3dVlmJkxatBZyFP43Si3I.cache +0 -2
  555. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/N1/N1EMMEzwuRyuF1gWtXmBNA8MMh4jYud3NP4IQ4_6APY.cache +0 -1
  556. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NV/NVd17BdcRmpEVFGZDHcRFIgNC2usd2N50atmE6dfOiI.cache +0 -1
  557. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NV/NvHlFPeFw2ONsOqGrVoMfZKZNz-6Hio21cxECqHgZd4.cache +0 -0
  558. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ON/ONTTDNMWFhjcmhKbOP3KqbRtGvxLORP9OH6wMiCk_Ys.cache +0 -2
  559. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ol/Olkqarn5mhfEd6uRArgjaOA-B1ZXvvcXpuIFVyoDAXc.cache +0 -0
  560. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/P-/P-STcrlrr_UHY2DAzJOcMU2FOt1STMToqoJ3hYaAEEE.cache +0 -1
  561. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PA/PAJgjBwkjHBCPPw8wWUsKsUR7TvgP4RK7PV8-Jdqluw.cache +0 -2
  562. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PA/paWxJFaOGYb5g3bPUex7k8lTzXqbJ4F0Uw_zBZI8XxU.cache +0 -1
  563. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/PP/PPmjUfdcsG-U5YdKOGrvFGoDVweIuWHjIggt6U2rRIo.cache +0 -0
  564. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Pm/PmTiqVQJ4334Q0J-QCdlEdApesHyk8Lwuunb-_RivmU.cache +0 -1
  565. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/QY/QYJsCmNADCk6tDZF57r1lz6gqD88LSPkQXtY3Vm-uUI.cache +0 -1
  566. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q_/Q_J_xCMNzLrUyke5pUNpWmyoVj_lW8yCigUKNE9FyXs.cache +0 -1
  567. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RB/RBv3Nnh3mIqYx7YWNYxr9uuJlQKt0sISacYDiDkOJ3w.cache +0 -1
  568. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RE/REff4oUdSjRZwuhZkynEkMbvKkAnflI5V3ti3ZCXtO0.cache +0 -2
  569. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rw/RwDuCV-XpnCtjNkvhpJfBuxXMk0b5AD3L9eR6M-wcy0.cache +0 -3
  570. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/S2/S2ulcWK2u8bC-jxhkG5P2oDyoR91wKtZkw6I5RfTz24.cache +0 -0
  571. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SD/SDQnsrLw-b0RFX481lQQF9x0HiZaefzuBAuOj3cwo9I.cache +0 -1
  572. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SD/sDGKBkb0LsWWFOmHNgz4ahOe6iLlCfJ8Zy8iInv4teI.cache +0 -0
  573. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SM/SMCVX47Gg93AptU_3a66VblIT3KLHqKrkHHuMhfPIxk.cache +0 -1
  574. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SQ/SQPrFInSYpfPUMfXYJXnph6q8eAFQsL_plvmqSwAVEM.cache +0 -2
  575. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/SR/SRppQZkF9KwCpA8Ud3swxGKHJUSM5M75OTHlmfiTeAY.cache +0 -1
  576. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TE/TEEzQHAX6KOPY3AIg2OPhwQPpIrKlcqGJnqKnvz9YDE.cache +0 -1
  577. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tr/Tr5ExKD0jPytz0PJn0sVycLrI6t9y-4wGKO4MTwzi2U.cache +0 -2
  578. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tr/TrY4Ml48luBYhVfMdvwlyB7zO-QQQaWIW7ORlLUnYRg.cache +0 -1
  579. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tt/Tt0V7r8e-tdXVEGXDjN31D88EHb3z-Jo47tXWmAPCwA.cache +0 -0
  580. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Tx/TxxBMsRYAeLcndv5YuF1FkCV30qi1yhYI8AzTki0Zmo.cache +0 -2
  581. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/U9/U9dnnrqeoOE-mYHdH4XmicZAjMQbjhjXdiA8VlMGsHA.cache +0 -0
  582. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UA/UA89Y066oW41G1gWoHWdEXcPU2JZ66j8dnXKwoc3yJc.cache +0 -2
  583. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UK/UKklu-xV4ZGx7P5-zWqENrlHQUaedqEuUNTgezjc3g0.cache +0 -2
  584. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UL/ULdjhhb0bRuqmaG7XSZlFYzGYCXTDnqZuJBTWRlzqgw.cache +0 -0
  585. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/US/USYEqEC54xCRgdxfID_BklmAl2jIXZAKJ9BhapbMqNg.cache +0 -1
  586. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Up/UpPNgh0yYoUsyMDh5zWqe_U6qJIyTC6-dxMMAs1vvlM.cache +0 -1
  587. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/V5/V5dKKdHyA7y6N44igdqPBARmoV0tYdUsUrmf2lJkF6M.cache +0 -1
  588. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VJ/VJ9Lp37PnSDzVOvhSVhKc2eG-KOuv3bRFxar6M8LLnA.cache +0 -1
  589. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VP/VPf8mKPeiYU53d-M_P60d-YL6wdTka1rTVRa4F5dB_k.cache +0 -0
  590. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/VY/VYJV9KoRx38NfAvSvXouEYF_0k-Su_KdFuSSXPOoSOg.cache +0 -1
  591. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/W2/W2nmNoF054n5uT-S7jhvUpaJqxHYWiJnHNP8fbjwjj0.cache +0 -1
  592. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WA/WA0OKbW1ShDLWAbN4voLShkG6JaNjvWeSNF3ZpLcUqY.cache +0 -0
  593. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Wg/Wguh-szFGTI1gaL6npYwPekMXflugRei7F_mOyRucXg.cache +0 -0
  594. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Wr/WriMHycrWjgHpmRpAo9N4nvDB5T0lBL5EOTTUQUHwn4.cache +0 -1
  595. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ws/WsHB1qkchRYVF4JV0Yqtr-QiyZ26DiLFtKTrCRVc5kI.cache +0 -0
  596. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/X-/X-khLYMA9mqFRPg3zAi86mREDxpKl4bdKYp3uF6WHos.cache +0 -0
  597. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XD/XDRDiP6A_Qz7pCCfZHYO6Xfob7trS4JQQoX_ByuWnRI.cache +0 -2
  598. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xr/XrGClLu5lOe_6gWU_Nm-tCAC6tUCFpoTPwyKLHmrnNw.cache +0 -0
  599. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xu/XU4k1OXnfMils5SrirorPvDSyDSqiOWLZNtmAH1HH8k.cache +0 -0
  600. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xu/XupuIipXyzmZQIRfy2SfGTCS21Y-sBxWWjFWmnxYllM.cache +0 -1
  601. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xx/XxkX9e-7J9By7nLHpwyUoOdUJ78twXYUefvXKie2WkA.cache +0 -1
  602. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yf/YfGn3oqi1Sm1_rHBqpmph8QpfhWTITbEUWS9waD_HKg.cache +0 -0
  603. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yf/yfhQwhH-ul-osfCM7_EXtSEeujd0TqsbqPoVgj7ehi0.cache +0 -0
  604. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Yl/YlIiT75oC_1vUeD7NoTHufIKf1Tdnjg82aJbfI79WGQ.cache +0 -2
  605. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Z-/Z--HP-BzybXzcZ6TPTFHonJqTM1B3B2g-5uUSi_EuSc.cache +0 -0
  606. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZT/ZTVpqYlcQg-w8iygSuUB7UBreT5bxLOPDNlKjzg5kMY.cache +0 -0
  607. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZT/ztYH9puOw0lwdIjwlH18IT68aY0KvTPEiAQTrxn4doQ.cache +0 -2
  608. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Za/ZaT_Lz8qe4rCd9sYS8dWxhl6MB_pWFUu7sqohGkRsAo.cache +0 -0
  609. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Zz/Zzsh2ASGqBSWLSWIU4fAyxS3iVuJDxdTCw8jOOsUNzA.cache +0 -1
  610. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_-/_-Y1fY6ejeTyiaDheuPSN_aPVwcvRdIlowBkfFxEY0c.cache +0 -0
  611. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_6/_61xcFfBTsk2JixNV1J-NP9FtW67n0Haapr-7H5toEU.cache +0 -2
  612. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_R/_RQaUmRUEEXsJ7wurDZfjh63xJqRWfkCTDSiA0pvOIg.cache +0 -2
  613. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_m/_mRvClvA9ew3lpKq5JBpjPY232J6bAj9K_XP3N2HFD8.cache +0 -0
  614. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_z/_zNZb_3SH_fXs-tDFm3LtWun9BlLzBVn3aDO9l6K-NQ.cache +0 -1
  615. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/a7/a7lacDViLUEaXFwV6UuZfTUood23K0X7_s2YYxP7dQw.cache +0 -1
  616. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aV/aVdjJbgLyd5MLwvnXSaX_83wDD0zG8DQnKs4hlOXOJ0.cache +0 -1
  617. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/al/alJwyXpJHF8RaBpaslorYD4Et6PO_-7Jr1qQmR_Wtys.cache +0 -0
  618. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bC/bCSJnsDI4K9-Hwd7p_GC9M36gA2QbYgtfl-Guk1Ev80.cache +0 -1
  619. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bM/bMopwpsFeLUsi20J9L9mPnoi6ZMJMVHIzxbTHbWrBho.cache +0 -2
  620. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bd/bdikSDf26RlvOPFhOT9G-XHnMj8ptHrTYB3QUuABCUQ.cache +0 -0
  621. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bi/BIkdhfxsezxM4q-HZ4oCNTq97WEJTigcq0tpX2cDvbY.cache +0 -0
  622. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bi/biczy7hoa1_tzXKc6t2QU3WdkhkfdBfwwq66GVVz914.cache +0 -1
  623. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bq/bqRZ6xUe_GzjdFbiyk0iMQoNHY4xk1gccuw3l8KUJz8.cache +0 -2
  624. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bv/bvfgzCTJxyiwgFWSXthcO14iFDl_K1NuT0vWVXcI-WU.cache +0 -0
  625. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cZ/cZw-zK9k1to5xz_hZ8FQB5wpR9Ks1-bhn7kJJVu9Ki0.cache +0 -1
  626. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ci/cipvvZ93wZHrDs_W1liu4PQTEJsKuPhbk6JG1DsMfxM.cache +0 -1
  627. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ck/ckLh5gBuqdrZ9fuxYz87cU_3hhZMI_7tcqNJ2EjtgpI.cache +0 -0
  628. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dG/dGyq85wVf9waxk23R1VlUQQMflMpPSsiMOTM9TtZ1f0.cache +0 -0
  629. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/d_/d_Ckuu1Nlhrqje-LDVqGwCu8pLiyAX31uSdo7QCELeI.cache +0 -2
  630. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/db/db0UgKlp2vcgigF3FfR0UlilfVgDEJuew9qxLsuR374.cache +0 -0
  631. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/db/dbXmPOhlH1AKN08KRg0ow8KOe-_XKeBNOg0HJvnqQCs.cache +0 -0
  632. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dr/drw7hbVGSDH0ujUo0r9Fmfbjvw8_eoOc6fCktj5IKak.cache +0 -2
  633. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/e7/e7SEwN9e5ctMuXdXSRM6IB2fFMiIP2UAmvXjDKktd5w.cache +0 -1
  634. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eW/eWG0d21oPZQGuYiCLej8OsRayN0--zxnvn7KHFqrQus.cache +0 -1
  635. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fA/fADdr9ULIrFxI-36hG3S8yfvCp2VHyR6WzSZNIPM3C0.cache +0 -1
  636. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fE/fEt1GN3H2qJiB0PwX6Cd43UrRkzLxTRIeUyyrydPe_A.cache +0 -2
  637. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ff/FfxmA4CMHQZT7exx0G7NS1Wpcnny0vzp-Jhc2H36bp8.cache +0 -1
  638. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ff/ffguBp3lFlcLuH9rWtl1JJxs9dDTIfm-FCMONYpUdww.cache +0 -1
  639. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gE/gEiiG4GZNy_djEjK2pHm_NgA-gyhLZhdQvo0Yt96GqE.cache +0 -0
  640. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gn/gnA9ZSqpjccNL2m8pe_jBvY6SinXlCzXDWyop83Od8s.cache +0 -1
  641. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/he/hepQXqLZteSsVIUXJaeKnrpVYKb53gbWe1xr6tuFN3Y.cache +0 -1
  642. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/hy/hyMfoAGcpyTZYoedJT2E2u3X96FEwATK-lIPMFlN_bw.cache +0 -0
  643. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/i9/I9UL3IEpQ14Bi9EpF3TLd0P5Rabp6ulJbgz2f1o-neA.cache +0 -1
  644. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/i9/i9lFglNaFPcJgnmxvuMjrY_R8pXY0CN9SiUKFgVFPSM.cache +0 -0
  645. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iE/iEzDISmI13GuIeJehYePCIVyUe7XZ-_q9pvIv0UzneM.cache +0 -1
  646. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/i_/i_hzz-9VlGYj7yvx9yYWRKRw2UwxqFHQrRZw6vzXsWc.cache +0 -0
  647. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ij/ijLUBXXLleeHIaUQp-SQmpq0HpH94rYlbW5OJbKpnsg.cache +0 -1
  648. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iq/iqPK1x8VfJwa8KcViAxJc6WCCa1dqE_7ubcbyoyjecg.cache +0 -1
  649. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/iw/iw-6QMCNXnMzL5koGPyFgnCllIbeX88-V7N5GRRqxLA.cache +0 -0
  650. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/j2/j2NpPyjDjX23FPlgIi_Hf4oc4HH6a74elyfPP9wF0jU.cache +0 -2
  651. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jK/jKof1JYBdCVS3OYs9Itw8Fbr1nIPR8DLSEB8WKSDLyw.cache +0 -2
  652. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jS/jSnpKdnMVeeGtUODVf-9I1I3xvGWQr4uOtIB8Oul4Zw.cache +0 -1
  653. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/jn/jnwTDvpqs0w9VZpZ5GUZ60o6cpUhzgo69c_ooHHmNvM.cache +0 -0
  654. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kU/kUok4qdkoYsQOP59lJgy9rPyE-T3sh8l0dVDE6KzfeI.cache +0 -1
  655. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kv/KVJz4npl0nKN-Dp49qjcOml4Tpxq_AZ8RNO1Bi387Is.cache +0 -2
  656. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kv/kvTGOzOr1lqLnY61yqldR_vtHpoCKFYDFpl7_fnCtcE.cache +0 -1
  657. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/kz/kz7lpLb0SoWDdaStz39DkoaQykVp0h3Jl4agZcEh6L4.cache +0 -1
  658. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/l8/l8UyUr0lncdtUUTZFwO0ulkW8Bl3z83viCwii7OewZk.cache +0 -1
  659. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lH/lHDGd3_dxi_xz9n5_wYFy7hKMxp78Q39u_XQKZWub_Y.cache +0 -0
  660. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lO/lOAan3cMwCE_Hli6gsDML88xFNfn0nxPmvrSkW7eEOw.cache +0 -1
  661. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lU/lUmP4mi3T8xmwS_odQgw8llzs35KCOMZCTv0DANy9dM.cache +0 -1
  662. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lY/lYdwx9C-FXcmiLA5bsEfQIBwpcg3twu1lz6rFXROyCI.cache +0 -0
  663. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lj/ljpGLuZae0hOTv1h7MGCiJ30O0qhPCuvEKLhD5zpV8Q.cache +0 -0
  664. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m1/M1pv8MJEPLXGLvS8QxVh3DSO9cI4mRt5FHFWdrvUj6o.cache +0 -2
  665. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m1/M1yW7a2h3VzoyhwmJIKGEXjCQN8GsQcnvcKaklurytE.cache +0 -1
  666. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m1/m1jB-0OsQz_CCr-Q_KIlpfF7BsJBF8GXMfk9pZdJsdg.cache +0 -0
  667. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m3/m3WJ72qtNo4wVe78N9YRArVH33D15hEwdVd67wJbvOQ.cache +0 -0
  668. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m4/m4EE0-xa87oylMzux18a-d2pR0zDtF2GCbYzwdSvQH4.cache +0 -0
  669. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m7/m77qH7ZqH0_0SmwJbiKGDd-aLau1Dav847DC6ge46zY.cache +0 -1
  670. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mS/mSWxg1xZbGaeYGDXMe8nsYZC_LfhiNdjSTL2J2ELE0s.cache +0 -0
  671. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mb/mb6HAyivnzHzDrkN35ifr4kL7MuksZYWamdJBUjhoHQ.cache +0 -0
  672. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/me/melFFxMi_bgtkEkztQhKusyFDqKEeVVzurk_1_TPt6A.cache +0 -1
  673. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mm/mms9rxcyPm09RjefBI321LIRPUAobgQ1X4A8Uu4w9Fc.cache +0 -0
  674. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nA/nA0Bu-48plSRK0cxt2gE2-TXvwcDsTjvHLFR7KshbPY.cache +0 -0
  675. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nA/nAGwhUtXjENu4Jl3uTJFFRnDhJAOlMAmuju7JcllSRM.cache +0 -1
  676. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nN/nN4lOF8mi-IWkm3zsqohaHbvJS4uG-_tiFsB6h1PsFc.cache +0 -0
  677. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ne/neLH-4_-lhKrkmcWjkrdYAoT5xDuc9EzJ5-81ZXeeXc.cache +0 -2
  678. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nj/njVJUsm_4wugUz9SwMbITIhSGErMWqSZ16AEUFn2RHo.cache +0 -0
  679. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nq/nqz2Ja53LHhXhFb6ChNpDKnBMWNdp17ZtNhrn-9wdR0.cache +0 -0
  680. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oY/oYHos9r6mwOX5jDyDTWjnpRR_SvWe4EX9gAl20Gqj8I.cache +0 -1
  681. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oj/ojlR_0dl68-YErHzTDzB8lO8nKxQzG6x_Axc5oWIeBg.cache +0 -2
  682. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pE/pE7gO6pQ-z187Swb4hT554wmqsq-cNzgPWLrCz-LQQQ.cache +0 -0
  683. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pG/pGc_RfrP3RwCp5SBabj-nGnfyeSnUp1Ed1ajCG5Yx-A.cache +0 -1
  684. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pQ/PQZm6DUZqIXs_3Wo9ISeQRb0vYyB0XG7iGSHr9_TWlc.cache +0 -0
  685. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pQ/pQXlqH4DBItuAHNMXGnwQmnzYkwJ2m7kUgKQbdbZM1E.cache +0 -0
  686. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pj/pJtdFKizdxA_xBjuuXQWYnEvCcImUQtT5Rh-tGG6v48.cache +0 -2
  687. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/pj/pjg7FTDRmEzqh8W3ijd1Y3GbffQuQwwSKEZ6ftoPnJE.cache +0 -2
  688. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ps/ps7w7RIcMoa1jxZu4r5mWxnZzl8qM4Bs9AietV5a9nU.cache +0 -0
  689. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qU/qUif8_vci3i4xpLoHjkoVXT-baN2Z_qabhqo2Wl1KU4.cache +0 -2
  690. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qf/qfMsgo__LLXJ_4thqBkUaDYPnaucsAJhMl6uN74w1GM.cache +0 -1
  691. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qj/qjbZ2Uz7G_0aKEQT3Nmuu0k2FkDTmVTemeoG3gw3oSw.cache +0 -1
  692. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qx/qxng7xwKb01YKazp0ij03cuEDbzSNSakHHwLx7XNEck.cache +0 -1
  693. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r5/r5EpktDep6rAU9paabInRkyyMPudlyFSWlHRFmSKXcI.cache +0 -1
  694. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rX/rX6desISJ78BGVzR2gPZKb2BiWY-N596DjfIgaTTkew.cache +0 -1
  695. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/r_/r_57OZEW0SEEUS9tJZwHYMvqjkbw3-3qfgomLAKJzoE.cache +0 -0
  696. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rh/rhT44pxmkWo5fhkEb829kceOiGof5L5L55DT5Uv9LKQ.cache +0 -0
  697. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/s4/s4BZ5EXO5EOticOtqwWaw3qjnMod3t0AfgXahBpqSZA.cache +0 -0
  698. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sj/sjRjnjRB37lH2vrgtkdJ8Cz84__IJ978IuKTM7HcztI.cache +0 -0
  699. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tF/tFofktc3WRxmXDS1NTWdUstzycUbsShJBMHatxLvxqQ.cache +0 -2
  700. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/tL/tLQy_cVJ8R8R35MKxmAuxHklAoaJTyXFO-eL8dXcMKY.cache +0 -1
  701. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/um/um1JrirR4hJhK-1rE-HywlyCi5ibgxHVrReiujZBWJM.cache +0 -1
  702. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v4/v4fwVytD7ITcE0_GDbslZEYud8a5Okm85fV1o7SDl6g.cache +0 -0
  703. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vH/vHyq2njTP0fsOdOun0eFn07YnFCTmJJkD89-pJ9tKYA.cache +0 -0
  704. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vK/vKDpBE4UJEuJjeJqLtVQSQ7wHxJ1ywxrRt8Y1XQBxtk.cache +0 -0
  705. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/vK/vk4eyljHSm11GcRNbA0QEqn13Y4bEfxOcBwiesL-XvQ.cache +0 -1
  706. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/v_/v_0PAQt0iipQjFP5zjgkkk9Stnpf4VzvnMv67d1Keuw.cache +0 -1
  707. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/w6/w6JBeSUs8dNJNtbRF-HVG3csGda2FlttAEBSpSHoqcE.cache +0 -0
  708. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wc/wcSdAX-yztEvzKx_xYHtqxT47ZyaLoLal_vKwPxEP08.cache +0 -2
  709. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wd/wdT9U4MKxe1PyqNjVuCKMpCl3dxGCIRJIlwUTfh2DQU.cache +0 -1
  710. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wh/whuY0tTNf66sTcgILzLfelCAHIBpDZZIiOIuI12HNQw.cache +0 -2
  711. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wi/wiKqSHxw-MJpM466KPFAcPyzBHxbpGGYW578TqFEJeg.cache +0 -1
  712. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wi/wixK89IvA4Xk2MyJxkyLg-2xRs2vRPzY_OIs37bi8XA.cache +0 -1
  713. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wz/wzY0ol5RRJK1j-hK9nckKoTMWK5TJDii5QSZMGTu5hk.cache +0 -0
  714. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/x3/x3jUhlqTEK-rA6zTC8_MWGyKD8tZRhz2nPu0nCBgEGI.cache +0 -1
  715. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xI/xIaxut_fEIhKBDqljTNwYaADK9kj3gG0ESrfHs-5_og.cache +0 -3
  716. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xL/xLZtF0WWBePfiVBWxxi6brXCLsEfcrj435b9xJupeeU.cache +0 -0
  717. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xL/xLktzniI5dkWKAifTMHzZvRHyRHOexsqV-ZRsdLXx0g.cache +0 -2
  718. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xv/xvoydM1zth53tauNTatJNfb-o44mAGDD9-85yRkpeqY.cache +0 -0
  719. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/y0/y0SJOqIx2fn1SKqOkAihsQow0trRJrSIyAswufVuoA8.cache +0 -0
  720. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yH/yHfd9J_SJGssjygyWK8-uLlvE6IlN6DIda7947QWVsI.cache +0 -1
  721. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yQ/yQP_20gvJZ1MfkfWE7nU-EFpqbMzANYy8OWuQuaDyLM.cache +0 -2
  722. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yv/yvOcRnWhg9dCjr1_rScAH4M8-rUQVY9oHFqBGVoMniI.cache +0 -0
  723. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z2/z2ro57FqSGT_X2jnC68fS-HrFmCh7Wbrnrm45BceZoM.cache +0 -0
  724. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zJ/zJfViroVCTZxyBh0pLP8_QiOxemqmKRkiU7BHAf5HxA.cache +0 -0
  725. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zP/zPBLf0GnkvCm86BY_8PtGJRyawPWy-JxWZp25_yNRfk.cache +0 -2
  726. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zg/zgpzeaX-KZErHyGJ1aBH3ZusweNXMneVZule88XsIJI.cache +0 -1
  727. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zm/zmEmiHcLam0fJ2odLUV8n4hg9GN2gBDrJo7JCkkg8f4.cache +0 -1
  728. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zy/zYFltDy-8VC-uKq2BVEiJJyYXNFvVzAKuMlR3ZIYZsk.cache +0 -0
  729. data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zy/zywotY5ANjNyE78CLDqC1eYRFwL1ZFzkT9J5LzNlI4M.cache +0 -1
  730. data/spec/dummy/tmp/restart.txt +0 -0
  731. data/spec/dummy/tmp/screenshots/failures_test_it_handles_subscriptions.png +0 -0
  732. data/spec/fixtures/upgrader/account.original.rb +0 -19
  733. data/spec/fixtures/upgrader/account.transformed.rb +0 -20
  734. data/spec/fixtures/upgrader/blame_range.original.rb +0 -43
  735. data/spec/fixtures/upgrader/blame_range.transformed.rb +0 -30
  736. data/spec/fixtures/upgrader/date_time.original.rb +0 -24
  737. data/spec/fixtures/upgrader/date_time.transformed.rb +0 -23
  738. data/spec/fixtures/upgrader/delete_project.original.rb +0 -28
  739. data/spec/fixtures/upgrader/delete_project.transformed.rb +0 -27
  740. data/spec/fixtures/upgrader/gist_order_field.original.rb +0 -14
  741. data/spec/fixtures/upgrader/gist_order_field.transformed.rb +0 -13
  742. data/spec/fixtures/upgrader/increment_count.original.rb +0 -59
  743. data/spec/fixtures/upgrader/increment_count.transformed.rb +0 -50
  744. data/spec/fixtures/upgrader/photo.original.rb +0 -10
  745. data/spec/fixtures/upgrader/photo.transformed.rb +0 -12
  746. data/spec/fixtures/upgrader/release_order.original.rb +0 -15
  747. data/spec/fixtures/upgrader/release_order.transformed.rb +0 -14
  748. data/spec/fixtures/upgrader/starrable.original.rb +0 -49
  749. data/spec/fixtures/upgrader/starrable.transformed.rb +0 -46
  750. data/spec/fixtures/upgrader/subscribable.original.rb +0 -55
  751. data/spec/fixtures/upgrader/subscribable.transformed.rb +0 -51
  752. data/spec/fixtures/upgrader/type_x.original.rb +0 -65
  753. data/spec/fixtures/upgrader/type_x.transformed.rb +0 -56
  754. data/spec/generators/graphql/enum_generator_spec.rb +0 -29
  755. data/spec/generators/graphql/function_generator_spec.rb +0 -59
  756. data/spec/generators/graphql/install_generator_spec.rb +0 -205
  757. data/spec/generators/graphql/interface_generator_spec.rb +0 -32
  758. data/spec/generators/graphql/loader_generator_spec.rb +0 -55
  759. data/spec/generators/graphql/mutation_generator_spec.rb +0 -65
  760. data/spec/generators/graphql/object_generator_spec.rb +0 -51
  761. data/spec/generators/graphql/union_generator_spec.rb +0 -64
  762. data/spec/graphql/analysis/analyze_query_spec.rb +0 -234
  763. data/spec/graphql/analysis/field_usage_spec.rb +0 -62
  764. data/spec/graphql/analysis/max_query_complexity_spec.rb +0 -102
  765. data/spec/graphql/analysis/max_query_depth_spec.rb +0 -101
  766. data/spec/graphql/analysis/query_complexity_spec.rb +0 -301
  767. data/spec/graphql/analysis/query_depth_spec.rb +0 -81
  768. data/spec/graphql/argument_spec.rb +0 -151
  769. data/spec/graphql/backtrace_spec.rb +0 -206
  770. data/spec/graphql/base_type_spec.rb +0 -169
  771. data/spec/graphql/boolean_type_spec.rb +0 -21
  772. data/spec/graphql/compatibility/execution_specification_spec.rb +0 -4
  773. data/spec/graphql/compatibility/lazy_execution_specification_spec.rb +0 -4
  774. data/spec/graphql/compatibility/query_parser_specification_spec.rb +0 -6
  775. data/spec/graphql/compatibility/schema_parser_specification_spec.rb +0 -6
  776. data/spec/graphql/define/assign_argument_spec.rb +0 -61
  777. data/spec/graphql/define/instance_definable_spec.rb +0 -203
  778. data/spec/graphql/directive/skip_directive_spec.rb +0 -9
  779. data/spec/graphql/directive_spec.rb +0 -253
  780. data/spec/graphql/enum_type_spec.rb +0 -153
  781. data/spec/graphql/execution/execute_spec.rb +0 -206
  782. data/spec/graphql/execution/instrumentation_spec.rb +0 -165
  783. data/spec/graphql/execution/lazy/lazy_method_map_spec.rb +0 -57
  784. data/spec/graphql/execution/lazy_spec.rb +0 -174
  785. data/spec/graphql/execution/multiplex_spec.rb +0 -183
  786. data/spec/graphql/execution/typecast_spec.rb +0 -47
  787. data/spec/graphql/execution_error_spec.rb +0 -292
  788. data/spec/graphql/field_spec.rb +0 -246
  789. data/spec/graphql/float_type_spec.rb +0 -16
  790. data/spec/graphql/function_spec.rb +0 -129
  791. data/spec/graphql/id_type_spec.rb +0 -33
  792. data/spec/graphql/input_object_type_spec.rb +0 -353
  793. data/spec/graphql/int_type_spec.rb +0 -16
  794. data/spec/graphql/interface_type_spec.rb +0 -152
  795. data/spec/graphql/internal_representation/print_spec.rb +0 -41
  796. data/spec/graphql/internal_representation/rewrite_spec.rb +0 -374
  797. data/spec/graphql/introspection/directive_type_spec.rb +0 -61
  798. data/spec/graphql/introspection/input_value_type_spec.rb +0 -105
  799. data/spec/graphql/introspection/introspection_query_spec.rb +0 -59
  800. data/spec/graphql/introspection/schema_type_spec.rb +0 -55
  801. data/spec/graphql/introspection/type_by_name_field_spec.rb +0 -38
  802. data/spec/graphql/introspection/type_type_spec.rb +0 -156
  803. data/spec/graphql/language/block_string_spec.rb +0 -70
  804. data/spec/graphql/language/definition_slice_spec.rb +0 -226
  805. data/spec/graphql/language/document_from_schema_definition_spec.rb +0 -770
  806. data/spec/graphql/language/equality_spec.rb +0 -84
  807. data/spec/graphql/language/generation_spec.rb +0 -36
  808. data/spec/graphql/language/lexer_spec.rb +0 -66
  809. data/spec/graphql/language/nodes_spec.rb +0 -45
  810. data/spec/graphql/language/parser_spec.rb +0 -90
  811. data/spec/graphql/language/printer_spec.rb +0 -203
  812. data/spec/graphql/language/visitor_spec.rb +0 -50
  813. data/spec/graphql/list_type_spec.rb +0 -57
  814. data/spec/graphql/non_null_type_spec.rb +0 -48
  815. data/spec/graphql/object_type_spec.rb +0 -192
  816. data/spec/graphql/query/arguments_spec.rb +0 -325
  817. data/spec/graphql/query/context_spec.rb +0 -264
  818. data/spec/graphql/query/executor_spec.rb +0 -310
  819. data/spec/graphql/query/literal_input_spec.rb +0 -91
  820. data/spec/graphql/query/result_spec.rb +0 -29
  821. data/spec/graphql/query/serial_execution/value_resolution_spec.rb +0 -109
  822. data/spec/graphql/query/variables_spec.rb +0 -355
  823. data/spec/graphql/query_spec.rb +0 -780
  824. data/spec/graphql/rake_task_spec.rb +0 -59
  825. data/spec/graphql/relay/array_connection_spec.rb +0 -290
  826. data/spec/graphql/relay/base_connection_spec.rb +0 -93
  827. data/spec/graphql/relay/connection_instrumentation_spec.rb +0 -83
  828. data/spec/graphql/relay/connection_resolve_spec.rb +0 -63
  829. data/spec/graphql/relay/connection_type_spec.rb +0 -81
  830. data/spec/graphql/relay/edge_spec.rb +0 -10
  831. data/spec/graphql/relay/mongo_relation_connection_spec.rb +0 -474
  832. data/spec/graphql/relay/mutation_spec.rb +0 -339
  833. data/spec/graphql/relay/node_spec.rb +0 -263
  834. data/spec/graphql/relay/page_info_spec.rb +0 -111
  835. data/spec/graphql/relay/range_add_spec.rb +0 -117
  836. data/spec/graphql/relay/relation_connection_spec.rb +0 -808
  837. data/spec/graphql/scalar_type_spec.rb +0 -66
  838. data/spec/graphql/schema/argument_spec.rb +0 -87
  839. data/spec/graphql/schema/build_from_definition_spec.rb +0 -1072
  840. data/spec/graphql/schema/catchall_middleware_spec.rb +0 -34
  841. data/spec/graphql/schema/enum_spec.rb +0 -74
  842. data/spec/graphql/schema/field_spec.rb +0 -225
  843. data/spec/graphql/schema/finder_spec.rb +0 -135
  844. data/spec/graphql/schema/input_object_spec.rb +0 -111
  845. data/spec/graphql/schema/instrumentation_spec.rb +0 -40
  846. data/spec/graphql/schema/interface_spec.rb +0 -185
  847. data/spec/graphql/schema/introspection_system_spec.rb +0 -39
  848. data/spec/graphql/schema/loader_spec.rb +0 -281
  849. data/spec/graphql/schema/member/accepts_definition_spec.rb +0 -111
  850. data/spec/graphql/schema/member/build_type_spec.rb +0 -17
  851. data/spec/graphql/schema/member/has_fields_spec.rb +0 -129
  852. data/spec/graphql/schema/member/type_system_helpers_spec.rb +0 -63
  853. data/spec/graphql/schema/middleware_chain_spec.rb +0 -57
  854. data/spec/graphql/schema/mutation_spec.rb +0 -148
  855. data/spec/graphql/schema/object_spec.rb +0 -175
  856. data/spec/graphql/schema/printer_spec.rb +0 -707
  857. data/spec/graphql/schema/relay_classic_mutation_spec.rb +0 -38
  858. data/spec/graphql/schema/rescue_middleware_spec.rb +0 -74
  859. data/spec/graphql/schema/resolver_spec.rb +0 -131
  860. data/spec/graphql/schema/scalar_spec.rb +0 -95
  861. data/spec/graphql/schema/timeout_middleware_spec.rb +0 -188
  862. data/spec/graphql/schema/traversal_spec.rb +0 -222
  863. data/spec/graphql/schema/type_expression_spec.rb +0 -39
  864. data/spec/graphql/schema/union_spec.rb +0 -65
  865. data/spec/graphql/schema/unique_within_type_spec.rb +0 -44
  866. data/spec/graphql/schema/validation_spec.rb +0 -355
  867. data/spec/graphql/schema/warden_spec.rb +0 -740
  868. data/spec/graphql/schema_spec.rb +0 -472
  869. data/spec/graphql/static_validation/rules/argument_literals_are_compatible_spec.rb +0 -272
  870. data/spec/graphql/static_validation/rules/arguments_are_defined_spec.rb +0 -69
  871. data/spec/graphql/static_validation/rules/directives_are_defined_spec.rb +0 -33
  872. data/spec/graphql/static_validation/rules/directives_are_in_valid_locations_spec.rb +0 -40
  873. data/spec/graphql/static_validation/rules/fields_are_defined_on_type_spec.rb +0 -162
  874. data/spec/graphql/static_validation/rules/fields_have_appropriate_selections_spec.rb +0 -53
  875. data/spec/graphql/static_validation/rules/fields_will_merge_spec.rb +0 -614
  876. data/spec/graphql/static_validation/rules/fragment_names_are_unique_spec.rb +0 -27
  877. data/spec/graphql/static_validation/rules/fragment_spreads_are_possible_spec.rb +0 -49
  878. data/spec/graphql/static_validation/rules/fragment_types_exist_spec.rb +0 -40
  879. data/spec/graphql/static_validation/rules/fragments_are_finite_spec.rb +0 -121
  880. data/spec/graphql/static_validation/rules/fragments_are_named_spec.rb +0 -23
  881. data/spec/graphql/static_validation/rules/fragments_are_on_composite_types_spec.rb +0 -53
  882. data/spec/graphql/static_validation/rules/fragments_are_used_spec.rb +0 -41
  883. data/spec/graphql/static_validation/rules/mutation_root_exists_spec.rb +0 -38
  884. data/spec/graphql/static_validation/rules/no_definitions_are_present_spec.rb +0 -28
  885. data/spec/graphql/static_validation/rules/operation_names_are_valid_spec.rb +0 -79
  886. data/spec/graphql/static_validation/rules/required_arguments_are_present_spec.rb +0 -64
  887. data/spec/graphql/static_validation/rules/subscription_root_exists_spec.rb +0 -33
  888. data/spec/graphql/static_validation/rules/unique_directives_per_location_spec.rb +0 -181
  889. data/spec/graphql/static_validation/rules/variable_default_values_are_correctly_typed_spec.rb +0 -137
  890. data/spec/graphql/static_validation/rules/variable_names_are_unique_spec.rb +0 -23
  891. data/spec/graphql/static_validation/rules/variable_usages_are_allowed_spec.rb +0 -232
  892. data/spec/graphql/static_validation/rules/variables_are_input_types_spec.rb +0 -74
  893. data/spec/graphql/static_validation/rules/variables_are_used_and_defined_spec.rb +0 -61
  894. data/spec/graphql/static_validation/type_stack_spec.rb +0 -38
  895. data/spec/graphql/static_validation/validator_spec.rb +0 -141
  896. data/spec/graphql/string_type_spec.rb +0 -80
  897. data/spec/graphql/subscriptions/serialize_spec.rb +0 -71
  898. data/spec/graphql/subscriptions_spec.rb +0 -483
  899. data/spec/graphql/tracing/active_support_notifications_tracing_spec.rb +0 -55
  900. data/spec/graphql/tracing/new_relic_tracing_spec.rb +0 -47
  901. data/spec/graphql/tracing/platform_tracing_spec.rb +0 -115
  902. data/spec/graphql/tracing/scout_tracing_spec.rb +0 -17
  903. data/spec/graphql/tracing_spec.rb +0 -52
  904. data/spec/graphql/union_type_spec.rb +0 -161
  905. data/spec/graphql/upgrader/member_spec.rb +0 -516
  906. data/spec/graphql/upgrader/schema_spec.rb +0 -82
  907. data/spec/rails_dependency_sanity_spec.rb +0 -14
  908. data/spec/spec_helper.rb +0 -113
  909. data/spec/support/base_generator_test.rb +0 -7
  910. data/spec/support/dummy/data.rb +0 -42
  911. data/spec/support/dummy/schema.rb +0 -459
  912. data/spec/support/jazz.rb +0 -544
  913. data/spec/support/lazy_helpers.rb +0 -150
  914. data/spec/support/magic_cards/schema.graphql +0 -33
  915. data/spec/support/minimum_input_object.rb +0 -21
  916. data/spec/support/new_relic.rb +0 -24
  917. data/spec/support/parser/filename_example.graphql +0 -5
  918. data/spec/support/parser/filename_example_error_1.graphql +0 -4
  919. data/spec/support/parser/filename_example_error_2.graphql +0 -5
  920. data/spec/support/star_trek/data.rb +0 -109
  921. data/spec/support/star_trek/schema.rb +0 -388
  922. data/spec/support/star_wars/data.rb +0 -109
  923. data/spec/support/star_wars/schema.rb +0 -392
  924. data/spec/support/static_validation_helpers.rb +0 -28
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
+ require "graphql/schema/addition"
2
3
  require "graphql/schema/base_64_encoder"
3
4
  require "graphql/schema/catchall_middleware"
4
5
  require "graphql/schema/default_parse_error"
5
6
  require "graphql/schema/default_type_error"
7
+ require "graphql/schema/find_inherited_value"
6
8
  require "graphql/schema/finder"
7
9
  require "graphql/schema/invalid_type_error"
8
10
  require "graphql/schema/introspection_system"
@@ -11,6 +13,7 @@ require "graphql/schema/middleware_chain"
11
13
  require "graphql/schema/null_mask"
12
14
  require "graphql/schema/possible_types"
13
15
  require "graphql/schema/rescue_middleware"
16
+ require "graphql/schema/timeout"
14
17
  require "graphql/schema/timeout_middleware"
15
18
  require "graphql/schema/traversal"
16
19
  require "graphql/schema/type_expression"
@@ -19,22 +22,34 @@ require "graphql/schema/validation"
19
22
  require "graphql/schema/warden"
20
23
  require "graphql/schema/build_from_definition"
21
24
 
22
-
25
+ require "graphql/schema/validator"
23
26
  require "graphql/schema/member"
27
+ require "graphql/schema/wrapper"
24
28
  require "graphql/schema/list"
25
29
  require "graphql/schema/non_null"
26
30
  require "graphql/schema/argument"
27
31
  require "graphql/schema/enum_value"
28
32
  require "graphql/schema/enum"
33
+ require "graphql/schema/field_extension"
29
34
  require "graphql/schema/field"
30
35
  require "graphql/schema/input_object"
31
36
  require "graphql/schema/interface"
37
+ require "graphql/schema/scalar"
38
+ require "graphql/schema/object"
39
+ require "graphql/schema/union"
40
+ require "graphql/schema/directive"
41
+ require "graphql/schema/directive/deprecated"
42
+ require "graphql/schema/directive/include"
43
+ require "graphql/schema/directive/skip"
44
+ require "graphql/schema/directive/feature"
45
+ require "graphql/schema/directive/flagged"
46
+ require "graphql/schema/directive/transform"
47
+ require "graphql/schema/type_membership"
48
+
32
49
  require "graphql/schema/resolver"
33
50
  require "graphql/schema/mutation"
34
51
  require "graphql/schema/relay_classic_mutation"
35
- require "graphql/schema/object"
36
- require "graphql/schema/scalar"
37
- require "graphql/schema/union"
52
+ require "graphql/schema/subscription"
38
53
 
39
54
  module GraphQL
40
55
  # A GraphQL schema which may be queried with {GraphQL::Query}.
@@ -44,7 +59,6 @@ module GraphQL
44
59
  # - types for exposing your application
45
60
  # - query analyzers for assessing incoming queries (including max depth & max complexity restrictions)
46
61
  # - execution strategies for running incoming queries
47
- # - middleware for interacting with execution
48
62
  #
49
63
  # Schemas start with root types, {Schema#query}, {Schema#mutation} and {Schema#subscription}.
50
64
  # The schema will traverse the tree of fields & types, using those as starting points.
@@ -56,54 +70,147 @@ module GraphQL
56
70
  # Schemas can specify how queries should be executed against them.
57
71
  # `query_execution_strategy`, `mutation_execution_strategy` and `subscription_execution_strategy`
58
72
  # each apply to corresponding root types.
59
- #
60
- # A schema accepts a `Relay::GlobalNodeIdentification` instance for use with Relay IDs.
61
- #
73
+ # #
62
74
  # @example defining a schema
63
- # MySchema = GraphQL::Schema.define do
75
+ # class MySchema < GraphQL::Schema
64
76
  # query QueryType
65
- # middleware PermissionMiddleware
66
- # rescue_from(ActiveRecord::RecordNotFound) { "Not found" }
67
77
  # # If types are only connected by way of interfaces, they must be added here
68
78
  # orphan_types ImageType, AudioType
69
79
  # end
70
80
  #
71
81
  class Schema
82
+ extend Forwardable
72
83
  extend GraphQL::Schema::Member::AcceptsDefinition
84
+ extend GraphQL::Schema::Member::HasAstNode
73
85
  include GraphQL::Define::InstanceDefinable
86
+ extend GraphQL::Define::InstanceDefinable::DeprecatedDefine
87
+ extend GraphQL::Schema::FindInheritedValue
88
+
89
+ class DuplicateTypeNamesError < GraphQL::Error
90
+ def initialize(type_name:, first_definition:, second_definition:, path:)
91
+ super("Multiple definitions for `#{type_name}`. Previously found #{first_definition.inspect} (#{first_definition.class}), then found #{second_definition.inspect} (#{second_definition.class}) at #{path.join(".")}")
92
+ end
93
+ end
94
+
95
+ class UnresolvedLateBoundTypeError < GraphQL::Error
96
+ attr_reader :type
97
+ def initialize(type:)
98
+ @type = type
99
+ super("Late bound type was never found: #{type.inspect}")
100
+ end
101
+ end
102
+
103
+ module LazyHandlingMethods
104
+ # Call the given block at the right time, either:
105
+ # - Right away, if `value` is not registered with `lazy_resolve`
106
+ # - After resolving `value`, if it's registered with `lazy_resolve` (eg, `Promise`)
107
+ # @api private
108
+ def after_lazy(value, &block)
109
+ if lazy?(value)
110
+ GraphQL::Execution::Lazy.new do
111
+ result = sync_lazy(value)
112
+ # The returned result might also be lazy, so check it, too
113
+ after_lazy(result, &block)
114
+ end
115
+ else
116
+ yield(value) if block_given?
117
+ end
118
+ end
119
+
120
+ # Override this method to handle lazy objects in a custom way.
121
+ # @param value [Object] an instance of a class registered with {.lazy_resolve}
122
+ # @return [Object] A GraphQL-ready (non-lazy) object
123
+ # @api private
124
+ def sync_lazy(value)
125
+ lazy_method = lazy_method_name(value)
126
+ if lazy_method
127
+ synced_value = value.public_send(lazy_method)
128
+ sync_lazy(synced_value)
129
+ else
130
+ value
131
+ end
132
+ end
133
+
134
+ # @return [Symbol, nil] The method name to lazily resolve `obj`, or nil if `obj`'s class wasn't registered with {#lazy_resolve}.
135
+ def lazy_method_name(obj)
136
+ lazy_methods.get(obj)
137
+ end
138
+
139
+ # @return [Boolean] True if this object should be lazily resolved
140
+ def lazy?(obj)
141
+ !!lazy_method_name(obj)
142
+ end
143
+
144
+ # Return a lazy if any of `maybe_lazies` are lazy,
145
+ # otherwise, call the block eagerly and return the result.
146
+ # @param maybe_lazies [Array]
147
+ # @api private
148
+ def after_any_lazies(maybe_lazies)
149
+ if maybe_lazies.any? { |l| lazy?(l) }
150
+ GraphQL::Execution::Lazy.all(maybe_lazies).then do |result|
151
+ yield result
152
+ end
153
+ else
154
+ yield maybe_lazies
155
+ end
156
+ end
157
+ end
158
+
159
+ include LazyHandlingMethods
160
+ extend LazyHandlingMethods
161
+
74
162
  accepts_definitions \
75
- :query, :mutation, :subscription,
76
163
  :query_execution_strategy, :mutation_execution_strategy, :subscription_execution_strategy,
77
- :max_depth, :max_complexity, :default_max_page_size,
164
+ :validate_timeout, :max_depth, :max_complexity, :default_max_page_size,
78
165
  :orphan_types, :resolve_type, :type_error, :parse_error,
166
+ :error_bubbling,
79
167
  :raise_definition_error,
80
168
  :object_from_id, :id_from_object,
81
169
  :default_mask,
82
170
  :cursor_encoder,
83
- directives: ->(schema, directives) { schema.directives = directives.reduce({}) { |m, d| m[d.name] = d; m }},
171
+ # If these are given as classes, normalize them. Accept `nil` when building from string.
172
+ query: ->(schema, t) { schema.query = t.respond_to?(:graphql_definition) ? t.graphql_definition : t },
173
+ mutation: ->(schema, t) { schema.mutation = t.respond_to?(:graphql_definition) ? t.graphql_definition : t },
174
+ subscription: ->(schema, t) { schema.subscription = t.respond_to?(:graphql_definition) ? t.graphql_definition : t },
175
+ disable_introspection_entry_points: ->(schema) { schema.disable_introspection_entry_points = true },
176
+ disable_schema_introspection_entry_point: ->(schema) { schema.disable_schema_introspection_entry_point = true },
177
+ disable_type_introspection_entry_point: ->(schema) { schema.disable_type_introspection_entry_point = true },
178
+ directives: ->(schema, directives) { schema.directives = directives.reduce({}) { |m, d| m[d.graphql_name] = d; m } },
179
+ directive: ->(schema, directive) { schema.directives[directive.graphql_name] = directive },
84
180
  instrument: ->(schema, type, instrumenter, after_built_ins: false) {
85
181
  if type == :field && after_built_ins
86
182
  type = :field_after_built_ins
87
183
  end
88
184
  schema.instrumenters[type] << instrumenter
89
185
  },
90
- query_analyzer: ->(schema, analyzer) { schema.query_analyzers << analyzer },
186
+ query_analyzer: ->(schema, analyzer) {
187
+ if analyzer == GraphQL::Authorization::Analyzer
188
+ GraphQL::Deprecation.warn("The Authorization query analyzer is deprecated. Authorizing at query runtime is generally a better idea.")
189
+ end
190
+ schema.query_analyzers << analyzer
191
+ },
91
192
  multiplex_analyzer: ->(schema, analyzer) { schema.multiplex_analyzers << analyzer },
92
193
  middleware: ->(schema, middleware) { schema.middleware << middleware },
93
194
  lazy_resolve: ->(schema, lazy_class, lazy_value_method) { schema.lazy_methods.set(lazy_class, lazy_value_method) },
94
- rescue_from: ->(schema, err_class, &block) { schema.rescue_from(err_class, &block)},
195
+ rescue_from: ->(schema, err_class, &block) { schema.rescue_from(err_class, &block) },
95
196
  tracer: ->(schema, tracer) { schema.tracers.push(tracer) }
96
197
 
198
+ ensure_defined :introspection_system
199
+
97
200
  attr_accessor \
98
201
  :query, :mutation, :subscription,
99
202
  :query_execution_strategy, :mutation_execution_strategy, :subscription_execution_strategy,
100
- :max_depth, :max_complexity, :default_max_page_size,
203
+ :validate_timeout, :max_depth, :max_complexity, :default_max_page_size,
101
204
  :orphan_types, :directives,
102
205
  :query_analyzers, :multiplex_analyzers, :instrumenters, :lazy_methods,
103
206
  :cursor_encoder,
104
207
  :ast_node,
105
208
  :raise_definition_error,
106
- :introspection_namespace
209
+ :introspection_namespace,
210
+ :analysis_engine
211
+
212
+ # [Boolean] True if this object bubbles validation errors up from a field into its parent InputObject, if there is one.
213
+ attr_accessor :error_bubbling
107
214
 
108
215
  # Single, long-lived instance of the provided subscriptions class, if there is one.
109
216
  # @return [GraphQL::Subscriptions]
@@ -120,8 +227,29 @@ module GraphQL
120
227
  # @return [Class] Instantiated for each query
121
228
  attr_accessor :context_class
122
229
 
230
+ # [Boolean] True if this object disables the introspection entry point fields
231
+ attr_accessor :disable_introspection_entry_points
232
+
233
+ def disable_introspection_entry_points?
234
+ !!@disable_introspection_entry_points
235
+ end
236
+
237
+ # [Boolean] True if this object disables the __schema introspection entry point field
238
+ attr_accessor :disable_schema_introspection_entry_point
239
+
240
+ def disable_schema_introspection_entry_point?
241
+ !!@disable_schema_introspection_entry_point
242
+ end
243
+
244
+ # [Boolean] True if this object disables the __type introspection entry point field
245
+ attr_accessor :disable_type_introspection_entry_point
246
+
247
+ def disable_type_introspection_entry_point?
248
+ !!@disable_type_introspection_entry_point
249
+ end
250
+
123
251
  class << self
124
- attr_accessor :default_execution_strategy
252
+ attr_writer :default_execution_strategy
125
253
  end
126
254
 
127
255
  def default_filter
@@ -132,11 +260,7 @@ module GraphQL
132
260
  # @see {Query#tracers} for query-specific tracers
133
261
  attr_reader :tracers
134
262
 
135
- self.default_execution_strategy = GraphQL::Execution::Execute
136
-
137
- BUILT_IN_TYPES = Hash[[INT_TYPE, STRING_TYPE, FLOAT_TYPE, BOOLEAN_TYPE, ID_TYPE].map{ |type| [type.name, type] }]
138
- DIRECTIVES = [GraphQL::Directive::IncludeDirective, GraphQL::Directive::SkipDirective, GraphQL::Directive::DeprecatedDirective]
139
- DYNAMIC_FIELDS = ["__type", "__typename", "__schema"]
263
+ DYNAMIC_FIELDS = ["__type", "__typename", "__schema"].freeze
140
264
 
141
265
  attr_reader :static_validator, :object_from_id_proc, :id_from_object_proc, :resolve_type_proc
142
266
 
@@ -144,7 +268,10 @@ module GraphQL
144
268
  @tracers = []
145
269
  @definition_error = nil
146
270
  @orphan_types = []
147
- @directives = DIRECTIVES.reduce({}) { |m, d| m[d.name] = d; m }
271
+ @directives = {}
272
+ self.class.default_directives.each do |name, dir|
273
+ @directives[name] = dir.graphql_definition
274
+ end
148
275
  @static_validator = GraphQL::StaticValidation::Validator.new(schema: self)
149
276
  @middleware = MiddlewareChain.new(final_step: GraphQL::Execution::Execute::FieldResolveStep)
150
277
  @query_analyzers = []
@@ -156,17 +283,34 @@ module GraphQL
156
283
  @parse_error_proc = DefaultParseError
157
284
  @instrumenters = Hash.new { |h, k| h[k] = [] }
158
285
  @lazy_methods = GraphQL::Execution::Lazy::LazyMethodMap.new
159
- @lazy_methods.set(GraphQL::Relay::ConnectionResolve::LazyNodesWrapper, :never_called)
286
+ @lazy_methods.set(GraphQL::Execution::Lazy, :value)
160
287
  @cursor_encoder = Base64Encoder
161
- # Default to the built-in execution strategy:
162
- @query_execution_strategy = self.class.default_execution_strategy
163
- @mutation_execution_strategy = self.class.default_execution_strategy
164
- @subscription_execution_strategy = self.class.default_execution_strategy
288
+ # For schema instances, default to legacy runtime modules
289
+ @analysis_engine = GraphQL::Analysis
290
+ @query_execution_strategy = GraphQL::Execution::Execute
291
+ @mutation_execution_strategy = GraphQL::Execution::Execute
292
+ @subscription_execution_strategy = GraphQL::Execution::Execute
165
293
  @default_mask = GraphQL::Schema::NullMask
166
294
  @rebuilding_artifacts = false
167
295
  @context_class = GraphQL::Query::Context
168
296
  @introspection_namespace = nil
169
297
  @introspection_system = nil
298
+ @interpreter = false
299
+ @error_bubbling = false
300
+ @disable_introspection_entry_points = false
301
+ @disable_schema_introspection_entry_point = false
302
+ @disable_type_introspection_entry_point = false
303
+ end
304
+
305
+ # @return [Boolean] True if using the new {GraphQL::Execution::Interpreter}
306
+ def interpreter?
307
+ query_execution_strategy == GraphQL::Execution::Interpreter &&
308
+ mutation_execution_strategy == GraphQL::Execution::Interpreter &&
309
+ subscription_execution_strategy == GraphQL::Execution::Interpreter
310
+ end
311
+
312
+ def inspect
313
+ "#<#{self.class.name} ...>"
170
314
  end
171
315
 
172
316
  def initialize_copy(other)
@@ -205,38 +349,25 @@ module GraphQL
205
349
  rescue_middleware.remove_handler(*args, &block)
206
350
  end
207
351
 
352
+ def using_ast_analysis?
353
+ @analysis_engine == GraphQL::Analysis::AST
354
+ end
355
+
208
356
  # For forwards-compatibility with Schema classes
209
357
  alias :graphql_definition :itself
210
358
 
211
- # Validate a query string according to this schema.
212
- # @param string_or_document [String, GraphQL::Language::Nodes::Document]
213
- # @return [Array<GraphQL::StaticValidation::Message>]
214
- def validate(string_or_document, rules: nil)
215
- doc = if string_or_document.is_a?(String)
216
- GraphQL.parse(string_or_document)
217
- else
218
- string_or_document
219
- end
220
- query = GraphQL::Query.new(self, document: doc)
221
- validator_opts = { schema: self }
222
- rules && (validator_opts[:rules] = rules)
223
- validator = GraphQL::StaticValidation::Validator.new(validator_opts)
224
- res = validator.validate(query)
225
- res[:errors]
226
- end
227
-
228
- def define(**kwargs, &block)
359
+ def deprecated_define(**kwargs, &block)
229
360
  super
230
361
  ensure_defined
231
362
  # Assert that all necessary configs are present:
232
363
  validation_error = Validation.validate(self)
233
- validation_error && raise(NotImplementedError, validation_error)
364
+ validation_error && raise(GraphQL::RequiredImplementationMissingError, validation_error)
234
365
  rebuild_artifacts
235
366
 
236
367
  @definition_error = nil
237
368
  nil
238
369
  rescue StandardError => err
239
- if @raise_definition_error || err.is_a?(CyclicalDefinitionError)
370
+ if @raise_definition_error || err.is_a?(CyclicalDefinitionError) || err.is_a?(GraphQL::RequiredImplementationMissingError)
240
371
  raise
241
372
  else
242
373
  # Raise this error _later_ to avoid messing with Rails constant loading
@@ -273,6 +404,10 @@ module GraphQL
273
404
  end
274
405
  end
275
406
 
407
+ def get_type(type_name)
408
+ @types[type_name]
409
+ end
410
+
276
411
  # @api private
277
412
  def introspection_system
278
413
  @introspection_system ||= begin
@@ -284,9 +419,13 @@ module GraphQL
284
419
  # Returns a list of Arguments and Fields referencing a certain type
285
420
  # @param type_name [String]
286
421
  # @return [Hash]
287
- def references_to(type_name)
422
+ def references_to(type_name = nil)
288
423
  rebuild_artifacts unless defined?(@type_reference_map)
289
- @type_reference_map.fetch(type_name, [])
424
+ if type_name
425
+ @type_reference_map.fetch(type_name, [])
426
+ else
427
+ @type_reference_map
428
+ end
290
429
  end
291
430
 
292
431
  # Returns a list of Union types in which a type is a member
@@ -364,8 +503,8 @@ module GraphQL
364
503
  def get_field(parent_type, field_name)
365
504
  with_definition_error_check do
366
505
  parent_type_name = case parent_type
367
- when GraphQL::BaseType
368
- parent_type.name
506
+ when GraphQL::BaseType, Class, Module
507
+ parent_type.graphql_name
369
508
  when String
370
509
  parent_type
371
510
  else
@@ -388,19 +527,29 @@ module GraphQL
388
527
  # Fields for this type, after instrumentation is applied
389
528
  # @return [Hash<String, GraphQL::Field>]
390
529
  def get_fields(type)
391
- @instrumented_field_map[type.name]
530
+ @instrumented_field_map[type.graphql_name]
392
531
  end
393
532
 
394
- def type_from_ast(ast_node)
395
- GraphQL::Schema::TypeExpression.build_type(self.types, ast_node)
533
+ def type_from_ast(ast_node, context:)
534
+ GraphQL::Schema::TypeExpression.build_type(self, ast_node)
396
535
  end
397
536
 
398
537
  # @see [GraphQL::Schema::Warden] Restricted access to members of a schema
399
538
  # @param type_defn [GraphQL::InterfaceType, GraphQL::UnionType] the type whose members you want to retrieve
539
+ # @param context [GraphQL::Query::Context] The context for the current query
400
540
  # @return [Array<GraphQL::ObjectType>] types which belong to `type_defn` in this schema
401
- def possible_types(type_defn)
402
- @possible_types ||= GraphQL::Schema::PossibleTypes.new(self)
403
- @possible_types.possible_types(type_defn)
541
+ def possible_types(type_defn, context = GraphQL::Query::NullContext)
542
+ if context == GraphQL::Query::NullContext
543
+ @possible_types ||= GraphQL::Schema::PossibleTypes.new(self)
544
+ @possible_types.possible_types(type_defn, context)
545
+ else
546
+ # Use the incoming context to cache this instance --
547
+ # if it were cached on the schema, we'd have a memory leak
548
+ # https://github.com/rmosolgo/graphql-ruby/issues/2878
549
+ ns = context.namespace(:possible_types)
550
+ per_query_possible_types = ns[:possible_types] ||= GraphQL::Schema::PossibleTypes.new(self)
551
+ per_query_possible_types.possible_types(type_defn, context)
552
+ end
404
553
  end
405
554
 
406
555
  # @see [GraphQL::Schema::Warden] Resticted access to root types
@@ -441,7 +590,7 @@ module GraphQL
441
590
  def resolve_type(type, object, ctx = :__undefined__)
442
591
  check_resolved_type(type, object, ctx) do |ok_type, ok_object, ok_ctx|
443
592
  if @resolve_type_proc.nil?
444
- raise(NotImplementedError, "Can't determine GraphQL type for: #{ok_object.inspect}, define `resolve_type (type, obj, ctx) -> { ... }` inside `Schema.define`.")
593
+ raise(GraphQL::RequiredImplementationMissingError, "Can't determine GraphQL type for: #{ok_object.inspect}, define `resolve_type (type, obj, ctx) -> { ... }` inside `Schema.define`.")
445
594
  end
446
595
  @resolve_type_proc.call(ok_type, ok_object, ok_ctx)
447
596
  end
@@ -462,6 +611,10 @@ module GraphQL
462
611
  object = object.object
463
612
  end
464
613
 
614
+ if type.respond_to?(:graphql_definition)
615
+ type = type.graphql_definition
616
+ end
617
+
465
618
  # Prefer a type-local function; fall back to the schema-level function
466
619
  type_proc = type && type.resolve_type_proc
467
620
  type_result = if type_proc
@@ -470,17 +623,20 @@ module GraphQL
470
623
  yield(type, object, ctx)
471
624
  end
472
625
 
473
- if type_result.respond_to?(:graphql_definition)
474
- type_result = type_result.graphql_definition
475
- end
476
-
477
626
  if type_result.nil?
478
627
  nil
479
- elsif !type_result.is_a?(GraphQL::BaseType)
480
- type_str = "#{type_result} (#{type_result.class.name})"
481
- raise "resolve_type(#{object}) returned #{type_str}, but it should return a GraphQL type"
482
628
  else
483
- type_result
629
+ after_lazy(type_result) do |resolved_type_result|
630
+ if resolved_type_result.respond_to?(:graphql_definition)
631
+ resolved_type_result = resolved_type_result.graphql_definition
632
+ end
633
+ if !resolved_type_result.is_a?(GraphQL::BaseType)
634
+ type_str = "#{resolved_type_result} (#{resolved_type_result.class.name})"
635
+ raise "resolve_type(#{object}) returned #{type_str}, but it should return a GraphQL type"
636
+ else
637
+ resolved_type_result
638
+ end
639
+ end
484
640
  end
485
641
  end
486
642
 
@@ -495,7 +651,7 @@ module GraphQL
495
651
  # @return [Any] The application object identified by `id`
496
652
  def object_from_id(id, ctx)
497
653
  if @object_from_id_proc.nil?
498
- raise(NotImplementedError, "Can't fetch an object for id \"#{id}\" because the schema's `object_from_id (id, ctx) -> { ... }` function is not defined")
654
+ raise(GraphQL::RequiredImplementationMissingError, "Can't fetch an object for id \"#{id}\" because the schema's `object_from_id (id, ctx) -> { ... }` function is not defined")
499
655
  else
500
656
  @object_from_id_proc.call(id, ctx)
501
657
  end
@@ -535,6 +691,44 @@ module GraphQL
535
691
  @type_error_proc = new_proc
536
692
  end
537
693
 
694
+ # Can't delegate to `class`
695
+ alias :_schema_class :class
696
+ def_delegators :_schema_class, :unauthorized_object, :unauthorized_field, :inaccessible_fields
697
+ def_delegators :_schema_class, :directive
698
+ def_delegators :_schema_class, :error_handler
699
+ def_delegators :_schema_class, :validate
700
+
701
+
702
+ # Given this schema member, find the class-based definition object
703
+ # whose `method_name` should be treated as an application hook
704
+ # @see {.visible?}
705
+ # @see {.accessible?}
706
+ def call_on_type_class(member, method_name, context, default:)
707
+ member = if member.respond_to?(:type_class)
708
+ member.type_class
709
+ else
710
+ member
711
+ end
712
+
713
+ if member.respond_to?(:relay_node_type) && (t = member.relay_node_type)
714
+ member = t
715
+ end
716
+
717
+ if member.respond_to?(method_name)
718
+ member.public_send(method_name, context)
719
+ else
720
+ default
721
+ end
722
+ end
723
+
724
+ def visible?(member, context)
725
+ call_on_type_class(member, :visible?, context, default: true)
726
+ end
727
+
728
+ def accessible?(member, context)
729
+ call_on_type_class(member, :accessible?, context, default: true)
730
+ end
731
+
538
732
  # A function to call when {#execute} receives an invalid query string
539
733
  #
540
734
  # @see {DefaultParseError} is the default behavior.
@@ -557,7 +751,7 @@ module GraphQL
557
751
  # @return [String] a unique identifier for `object` which clients can use to refetch it
558
752
  def id_from_object(object, type, ctx)
559
753
  if @id_from_object_proc.nil?
560
- raise(NotImplementedError, "Can't generate an ID for #{object.inspect} of type #{type}, schema's `id_from_object` must be defined")
754
+ raise(GraphQL::RequiredImplementationMissingError, "Can't generate an ID for #{object.inspect} of type #{type}, schema's `id_from_object` must be defined")
561
755
  else
562
756
  @id_from_object_proc.call(object, type, ctx)
563
757
  end
@@ -579,30 +773,30 @@ module GraphQL
579
773
  # @param definition_or_path [String] A schema definition string, or a path to a file containing the definition
580
774
  # @param default_resolve [<#call(type, field, obj, args, ctx)>] A callable for handling field resolution
581
775
  # @param parser [Object] An object for handling definition string parsing (must respond to `parse`)
582
- # @return [GraphQL::Schema] the schema described by `document`
583
- def self.from_definition(definition_or_path, default_resolve: BuildFromDefinition::DefaultResolve, parser: BuildFromDefinition::DefaultParser)
776
+ # @param using [Hash] Plugins to attach to the created schema with `use(key, value)`
777
+ # @return [Class] the schema described by `document`
778
+ def self.from_definition(definition_or_path, default_resolve: nil, parser: GraphQL.default_parser, using: {})
584
779
  # If the file ends in `.graphql`, treat it like a filepath
585
- definition = if definition_or_path.end_with?(".graphql")
586
- File.read(definition_or_path)
780
+ if definition_or_path.end_with?(".graphql")
781
+ GraphQL::Schema::BuildFromDefinition.from_definition_path(
782
+ definition_or_path,
783
+ default_resolve: default_resolve,
784
+ parser: parser,
785
+ using: using,
786
+ )
587
787
  else
588
- definition_or_path
788
+ GraphQL::Schema::BuildFromDefinition.from_definition(
789
+ definition_or_path,
790
+ default_resolve: default_resolve,
791
+ parser: parser,
792
+ using: using,
793
+ )
589
794
  end
590
- GraphQL::Schema::BuildFromDefinition.from_definition(definition, default_resolve: default_resolve, parser: parser)
591
795
  end
592
796
 
593
797
  # Error that is raised when [#Schema#from_definition] is passed an invalid schema definition string.
594
798
  class InvalidDocumentError < Error; end;
595
799
 
596
- # @return [Symbol, nil] The method name to lazily resolve `obj`, or nil if `obj`'s class wasn't registered wtih {#lazy_resolve}.
597
- def lazy_method_name(obj)
598
- @lazy_methods.get(obj)
599
- end
600
-
601
- # @return [Boolean] True if this object should be lazily resolved
602
- def lazy?(obj)
603
- !!lazy_method_name(obj)
604
- end
605
-
606
800
  # Return the GraphQL IDL for the schema
607
801
  # @param context [Hash]
608
802
  # @param only [<#call(member, ctx)>]
@@ -613,9 +807,12 @@ module GraphQL
613
807
  end
614
808
 
615
809
  # Return the GraphQL::Language::Document IDL AST for the schema
810
+ # @param context [Hash]
811
+ # @param only [<#call(member, ctx)>]
812
+ # @param except [<#call(member, ctx)>]
616
813
  # @return [GraphQL::Language::Document]
617
- def to_document
618
- GraphQL::Language::DocumentFromSchemaDefinition.new(self).document
814
+ def to_document(only: nil, except: nil, context: {})
815
+ GraphQL::Language::DocumentFromSchemaDefinition.new(self, only: only, except: except, context: context).document
619
816
  end
620
817
 
621
818
  # Return the Hash response of {Introspection::INTROSPECTION_QUERY}.
@@ -624,7 +821,7 @@ module GraphQL
624
821
  # @param except [<#call(member, ctx)>]
625
822
  # @return [Hash] GraphQL result
626
823
  def as_json(only: nil, except: nil, context: {})
627
- execute(Introspection::INTROSPECTION_QUERY, only: only, except: except, context: context).to_h
824
+ execute(Introspection.query(include_deprecated_args: true), only: only, except: except, context: context).to_h
628
825
  end
629
826
 
630
827
  # Returns the JSON response of {Introspection::INTROSPECTION_QUERY}.
@@ -634,6 +831,12 @@ module GraphQL
634
831
  JSON.pretty_generate(as_json(*args))
635
832
  end
636
833
 
834
+ def new_connections?
835
+ !!connections
836
+ end
837
+
838
+ attr_accessor :connections
839
+
637
840
  class << self
638
841
  extend Forwardable
639
842
  # For compatibility, these methods all:
@@ -641,52 +844,108 @@ module GraphQL
641
844
  # - Delegate to that instance
642
845
  # Eventually, the methods will be moved into this class, removing the need for the singleton.
643
846
  def_delegators :graphql_definition,
644
- # Schema structure
645
- :as_json, :to_json, :to_document, :to_definition,
646
847
  # Execution
647
- :execute, :multiplex,
648
- :static_validator, :introspection_system,
649
- :query_analyzers, :middleware, :tracers, :instrumenters,
650
- :query_execution_strategy, :mutation_execution_strategy, :subscription_execution_strategy,
651
- :validate, :multiplex_analyzers, :lazy?, :lazy_method_name,
848
+ :execution_strategy_for_operation,
652
849
  # Configuration
653
- :max_complexity=, :max_depth=,
654
- :metadata,
655
- :default_filter, :redefine,
850
+ :metadata, :redefine,
656
851
  :id_from_object_proc, :object_from_id_proc,
657
- :id_from_object=, :object_from_id=, :type_error,
658
- :remove_handler,
659
- # Members
660
- :types, :get_fields, :find,
661
- :root_type_for_operation,
662
- :subscriptions,
663
- :union_memberships,
664
- :get_field, :root_types, :references_to, :type_from_ast,
665
- :possible_types, :get_field
852
+ :id_from_object=, :object_from_id=,
853
+ :remove_handler
854
+
855
+ # @return [GraphQL::Subscriptions]
856
+ attr_accessor :subscriptions
857
+
858
+ # Returns the JSON response of {Introspection::INTROSPECTION_QUERY}.
859
+ # @see {#as_json}
860
+ # @return [String]
861
+ def to_json(**args)
862
+ JSON.pretty_generate(as_json(**args))
863
+ end
864
+
865
+ # Return the Hash response of {Introspection::INTROSPECTION_QUERY}.
866
+ # @param context [Hash]
867
+ # @param only [<#call(member, ctx)>]
868
+ # @param except [<#call(member, ctx)>]
869
+ # @return [Hash] GraphQL result
870
+ def as_json(only: nil, except: nil, context: {})
871
+ execute(Introspection.query(include_deprecated_args: true), only: only, except: except, context: context).to_h
872
+ end
873
+
874
+ # Return the GraphQL IDL for the schema
875
+ # @param context [Hash]
876
+ # @param only [<#call(member, ctx)>]
877
+ # @param except [<#call(member, ctx)>]
878
+ # @return [String]
879
+ def to_definition(only: nil, except: nil, context: {})
880
+ GraphQL::Schema::Printer.print_schema(self, only: only, except: except, context: context)
881
+ end
882
+
883
+ # Return the GraphQL::Language::Document IDL AST for the schema
884
+ # @return [GraphQL::Language::Document]
885
+ def to_document
886
+ GraphQL::Language::DocumentFromSchemaDefinition.new(self).document
887
+ end
888
+
889
+ def find(path)
890
+ if !@finder
891
+ @find_cache = {}
892
+ @finder ||= GraphQL::Schema::Finder.new(self)
893
+ end
894
+ @find_cache[path] ||= @finder.find(path)
895
+ end
666
896
 
667
897
  def graphql_definition
668
898
  @graphql_definition ||= to_graphql
669
899
  end
670
900
 
671
- def use(plugin, options = {})
672
- plugins << [plugin, options]
901
+ def default_filter
902
+ GraphQL::Filter.new(except: default_mask)
903
+ end
904
+
905
+ def default_mask(new_mask = nil)
906
+ if new_mask
907
+ @own_default_mask = new_mask
908
+ else
909
+ @own_default_mask || find_inherited_value(:default_mask, Schema::NullMask)
910
+ end
911
+ end
912
+
913
+ def static_validator
914
+ GraphQL::StaticValidation::Validator.new(schema: self)
915
+ end
916
+
917
+ def use(plugin, **kwargs)
918
+ if kwargs.any?
919
+ plugin.use(self, **kwargs)
920
+ else
921
+ plugin.use(self)
922
+ end
923
+ own_plugins << [plugin, kwargs]
673
924
  end
674
925
 
675
926
  def plugins
676
- @plugins ||= []
927
+ find_inherited_value(:plugins, EMPTY_ARRAY) + own_plugins
677
928
  end
678
929
 
679
930
  def to_graphql
680
931
  schema_defn = self.new
681
932
  schema_defn.raise_definition_error = true
682
- schema_defn.query = query
683
- schema_defn.mutation = mutation
684
- schema_defn.subscription = subscription
933
+ schema_defn.query = query && query.graphql_definition
934
+ schema_defn.mutation = mutation && mutation.graphql_definition
935
+ schema_defn.subscription = subscription && subscription.graphql_definition
936
+ schema_defn.validate_timeout = validate_timeout
685
937
  schema_defn.max_complexity = max_complexity
938
+ schema_defn.error_bubbling = error_bubbling
686
939
  schema_defn.max_depth = max_depth
687
940
  schema_defn.default_max_page_size = default_max_page_size
688
- schema_defn.orphan_types = orphan_types
689
- schema_defn.directives = directives
941
+ schema_defn.orphan_types = orphan_types.map(&:graphql_definition)
942
+ schema_defn.disable_introspection_entry_points = disable_introspection_entry_points?
943
+ schema_defn.disable_schema_introspection_entry_point = disable_schema_introspection_entry_point?
944
+ schema_defn.disable_type_introspection_entry_point = disable_type_introspection_entry_point?
945
+
946
+ prepped_dirs = {}
947
+ directives.each { |k, v| prepped_dirs[k] = v.graphql_definition}
948
+ schema_defn.directives = prepped_dirs
690
949
  schema_defn.introspection_namespace = introspection
691
950
  schema_defn.resolve_type = method(:resolve_type)
692
951
  schema_defn.object_from_id = method(:object_from_id)
@@ -694,119 +953,465 @@ module GraphQL
694
953
  schema_defn.type_error = method(:type_error)
695
954
  schema_defn.context_class = context_class
696
955
  schema_defn.cursor_encoder = cursor_encoder
697
- schema_defn.tracers.concat(defined_tracers)
698
- schema_defn.query_analyzers.concat(defined_query_analyzers)
699
- schema_defn.middleware.concat(defined_middleware)
700
- schema_defn.multiplex_analyzers.concat(defined_multiplex_analyzers)
701
- defined_instrumenters.each do |step, insts|
956
+ schema_defn.tracers.concat(tracers)
957
+ schema_defn.query_analyzers.concat(query_analyzers)
958
+ schema_defn.analysis_engine = analysis_engine
959
+
960
+ schema_defn.middleware.concat(all_middleware)
961
+ schema_defn.multiplex_analyzers.concat(multiplex_analyzers)
962
+ schema_defn.query_execution_strategy = query_execution_strategy
963
+ schema_defn.mutation_execution_strategy = mutation_execution_strategy
964
+ schema_defn.subscription_execution_strategy = subscription_execution_strategy
965
+ schema_defn.default_mask = default_mask
966
+ instrumenters.each do |step, insts|
702
967
  insts.each do |inst|
703
968
  schema_defn.instrumenters[step] << inst
704
969
  end
705
970
  end
706
- schema_defn.instrumenters[:query] << GraphQL::Schema::Member::Instrumentation
707
- lazy_classes.each do |lazy_class, value_method|
971
+
972
+ lazy_methods.each do |lazy_class, value_method|
708
973
  schema_defn.lazy_methods.set(lazy_class, value_method)
709
974
  end
710
- if @rescues
711
- @rescues.each do |err_class, handler|
712
- schema_defn.rescue_from(err_class, &handler)
713
- end
975
+
976
+ error_handler.each_rescue do |err_class, handler|
977
+ schema_defn.rescue_from(err_class, &handler)
714
978
  end
715
979
 
716
- if plugins.any?
717
- schema_plugins = plugins
718
- # TODO don't depend on .define
719
- schema_defn = schema_defn.redefine do
720
- schema_plugins.each do |plugin, options|
721
- if options.any?
722
- use(plugin, **options)
723
- else
724
- use(plugin)
725
- end
726
- end
727
- end
980
+ schema_defn.subscriptions ||= self.subscriptions
981
+
982
+ if !schema_defn.interpreter?
983
+ schema_defn.instrumenters[:query] << GraphQL::Schema::Member::Instrumentation
728
984
  end
985
+
986
+ if new_connections?
987
+ schema_defn.connections = self.connections
988
+ end
989
+
729
990
  schema_defn.send(:rebuild_artifacts)
730
991
 
731
992
  schema_defn
732
993
  end
733
994
 
995
+ # Build a map of `{ name => type }` and return it
996
+ # @return [Hash<String => Class>] A dictionary of type classes by their GraphQL name
997
+ # @see get_type Which is more efficient for finding _one type_ by name, because it doesn't merge hashes.
998
+ def types
999
+ non_introspection_types.merge(introspection_system.types)
1000
+ end
1001
+
1002
+ # @param type_name [String]
1003
+ # @return [Module, nil] A type, or nil if there's no type called `type_name`
1004
+ def get_type(type_name)
1005
+ own_types[type_name] ||
1006
+ introspection_system.types[type_name] ||
1007
+ find_inherited_value(:types, EMPTY_HASH)[type_name]
1008
+ end
1009
+
1010
+ # @api private
1011
+ attr_writer :connections
1012
+
1013
+ # @return [GraphQL::Pagination::Connections] if installed
1014
+ def connections
1015
+ if defined?(@connections)
1016
+ @connections
1017
+ else
1018
+ inherited_connections = find_inherited_value(:connections, nil)
1019
+ # This schema is part of an inheritance chain which is using new connections,
1020
+ # make a new instance, so we don't pollute the upstream one.
1021
+ if inherited_connections
1022
+ @connections = Pagination::Connections.new(schema: self)
1023
+ else
1024
+ nil
1025
+ end
1026
+ end
1027
+ end
1028
+
1029
+ def new_connections?
1030
+ !!connections
1031
+ end
1032
+
734
1033
  def query(new_query_object = nil)
735
1034
  if new_query_object
736
- @query_object = new_query_object
1035
+ if @query_object
1036
+ raise GraphQL::Error, "Second definition of `query(...)` (#{new_query_object.inspect}) is invalid, already configured with #{@query_object.inspect}"
1037
+ else
1038
+ @query_object = new_query_object
1039
+ add_type_and_traverse(new_query_object, root: true)
1040
+ nil
1041
+ end
737
1042
  else
738
- @query_object.respond_to?(:graphql_definition) ? @query_object.graphql_definition : @query_object
1043
+ @query_object || find_inherited_value(:query)
739
1044
  end
740
1045
  end
741
1046
 
742
1047
  def mutation(new_mutation_object = nil)
743
1048
  if new_mutation_object
744
- @mutation_object = new_mutation_object
1049
+ if @mutation_object
1050
+ raise GraphQL::Error, "Second definition of `mutation(...)` (#{new_mutation_object.inspect}) is invalid, already configured with #{@mutation_object.inspect}"
1051
+ else
1052
+ @mutation_object = new_mutation_object
1053
+ add_type_and_traverse(new_mutation_object, root: true)
1054
+ nil
1055
+ end
745
1056
  else
746
- @mutation_object.respond_to?(:graphql_definition) ? @mutation_object.graphql_definition : @mutation_object
1057
+ @mutation_object || find_inherited_value(:mutation)
747
1058
  end
748
1059
  end
749
1060
 
750
1061
  def subscription(new_subscription_object = nil)
751
1062
  if new_subscription_object
752
- @subscription_object = new_subscription_object
1063
+ if @subscription_object
1064
+ raise GraphQL::Error, "Second definition of `subscription(...)` (#{new_subscription_object.inspect}) is invalid, already configured with #{@subscription_object.inspect}"
1065
+ else
1066
+ @subscription_object = new_subscription_object
1067
+ add_subscription_extension_if_necessary
1068
+ add_type_and_traverse(new_subscription_object, root: true)
1069
+ nil
1070
+ end
1071
+ else
1072
+ @subscription_object || find_inherited_value(:subscription)
1073
+ end
1074
+ end
1075
+
1076
+ # @see [GraphQL::Schema::Warden] Resticted access to root types
1077
+ # @return [GraphQL::ObjectType, nil]
1078
+ def root_type_for_operation(operation)
1079
+ case operation
1080
+ when "query"
1081
+ query
1082
+ when "mutation"
1083
+ mutation
1084
+ when "subscription"
1085
+ subscription
1086
+ else
1087
+ raise ArgumentError, "unknown operation type: #{operation}"
1088
+ end
1089
+ end
1090
+
1091
+ def root_types
1092
+ @root_types
1093
+ end
1094
+
1095
+ # @param type [Module] The type definition whose possible types you want to see
1096
+ # @return [Hash<String, Module>] All possible types, if no `type` is given.
1097
+ # @return [Array<Module>] Possible types for `type`, if it's given.
1098
+ def possible_types(type = nil, context = GraphQL::Query::NullContext)
1099
+ if type
1100
+ # TODO duck-typing `.possible_types` would probably be nicer here
1101
+ if type.kind.union?
1102
+ type.possible_types(context: context)
1103
+ else
1104
+ stored_possible_types = own_possible_types[type.graphql_name]
1105
+ visible_possible_types = if stored_possible_types && type.kind.interface?
1106
+ stored_possible_types.select do |possible_type|
1107
+ # Use `.graphql_name` comparison to match legacy vs class-based types.
1108
+ # When we don't need to support legacy `.define` types, use `.include?(type)` instead.
1109
+ possible_type.interfaces(context).any? { |interface| interface.graphql_name == type.graphql_name }
1110
+ end
1111
+ else
1112
+ stored_possible_types
1113
+ end
1114
+ visible_possible_types ||
1115
+ introspection_system.possible_types[type.graphql_name] ||
1116
+ (
1117
+ superclass.respond_to?(:possible_types) ?
1118
+ superclass.possible_types(type, context) :
1119
+ EMPTY_ARRAY
1120
+ )
1121
+ end
1122
+ else
1123
+ find_inherited_value(:possible_types, EMPTY_HASH)
1124
+ .merge(own_possible_types)
1125
+ .merge(introspection_system.possible_types)
1126
+ end
1127
+ end
1128
+
1129
+ def union_memberships(type = nil)
1130
+ if type
1131
+ own_um = own_union_memberships.fetch(type.graphql_name, EMPTY_ARRAY)
1132
+ inherited_um = find_inherited_value(:union_memberships, EMPTY_HASH).fetch(type.graphql_name, EMPTY_ARRAY)
1133
+ own_um + inherited_um
1134
+ else
1135
+ joined_um = own_union_memberships.dup
1136
+ find_inherited_value(:union_memberhips, EMPTY_HASH).each do |k, v|
1137
+ um = joined_um[k] ||= []
1138
+ um.concat(v)
1139
+ end
1140
+ joined_um
1141
+ end
1142
+ end
1143
+
1144
+ # @api private
1145
+ # @see GraphQL::Dataloader
1146
+ def dataloader_class
1147
+ @dataloader_class || GraphQL::Dataloader::NullDataloader
1148
+ end
1149
+
1150
+ attr_writer :dataloader_class
1151
+
1152
+ def references_to(to_type = nil, from: nil)
1153
+ @own_references_to ||= Hash.new { |h, k| h[k] = [] }
1154
+ if to_type
1155
+ if !to_type.is_a?(String)
1156
+ to_type = to_type.graphql_name
1157
+ end
1158
+
1159
+ if from
1160
+ @own_references_to[to_type] << from
1161
+ else
1162
+ own_refs = @own_references_to[to_type]
1163
+ inherited_refs = find_inherited_value(:references_to, EMPTY_HASH)[to_type] || EMPTY_ARRAY
1164
+ own_refs + inherited_refs
1165
+ end
1166
+ else
1167
+ # `@own_references_to` can be quite large for big schemas,
1168
+ # and generally speaking, we won't inherit any values.
1169
+ # So optimize the most common case -- don't create a duplicate Hash.
1170
+ inherited_value = find_inherited_value(:references_to, EMPTY_HASH)
1171
+ if inherited_value.any?
1172
+ inherited_value.merge(@own_references_to)
1173
+ else
1174
+ @own_references_to
1175
+ end
1176
+ end
1177
+ end
1178
+
1179
+ def type_from_ast(ast_node, context: nil)
1180
+ type_owner = context ? context.warden : self
1181
+ GraphQL::Schema::TypeExpression.build_type(type_owner, ast_node)
1182
+ end
1183
+
1184
+ def get_field(type_or_name, field_name)
1185
+ parent_type = case type_or_name
1186
+ when LateBoundType
1187
+ get_type(type_or_name.name)
1188
+ when String
1189
+ get_type(type_or_name)
1190
+ when Module
1191
+ type_or_name
753
1192
  else
754
- @subscription_object.respond_to?(:graphql_definition) ? @subscription_object.graphql_definition : @subscription_object
1193
+ raise ArgumentError, "unexpected field owner for #{field_name.inspect}: #{type_or_name.inspect} (#{type_or_name.class})"
755
1194
  end
1195
+
1196
+ if parent_type.kind.fields? && (field = parent_type.get_field(field_name))
1197
+ field
1198
+ elsif parent_type == query && (entry_point_field = introspection_system.entry_point(name: field_name))
1199
+ entry_point_field
1200
+ elsif (dynamic_field = introspection_system.dynamic_field(name: field_name))
1201
+ dynamic_field
1202
+ else
1203
+ nil
1204
+ end
1205
+ end
1206
+
1207
+ def get_fields(type)
1208
+ type.fields
756
1209
  end
757
1210
 
758
1211
  def introspection(new_introspection_namespace = nil)
759
1212
  if new_introspection_namespace
760
1213
  @introspection = new_introspection_namespace
1214
+ # reset this cached value:
1215
+ @introspection_system = nil
761
1216
  else
762
- @introspection
1217
+ @introspection || find_inherited_value(:introspection)
763
1218
  end
764
1219
  end
765
1220
 
1221
+ def introspection_system
1222
+ if !@introspection_system
1223
+ @introspection_system = Schema::IntrospectionSystem.new(self)
1224
+ @introspection_system.resolve_late_bindings
1225
+ end
1226
+ @introspection_system
1227
+ end
1228
+
766
1229
  def cursor_encoder(new_encoder = nil)
767
1230
  if new_encoder
768
1231
  @cursor_encoder = new_encoder
769
1232
  end
770
- @cursor_encoder || Base64Encoder
1233
+ @cursor_encoder || find_inherited_value(:cursor_encoder, Base64Encoder)
771
1234
  end
772
1235
 
773
1236
  def default_max_page_size(new_default_max_page_size = nil)
774
1237
  if new_default_max_page_size
775
1238
  @default_max_page_size = new_default_max_page_size
776
1239
  else
777
- @default_max_page_size
1240
+ @default_max_page_size || find_inherited_value(:default_max_page_size)
778
1241
  end
779
1242
  end
780
1243
 
1244
+ def query_execution_strategy(new_query_execution_strategy = nil)
1245
+ if new_query_execution_strategy
1246
+ @query_execution_strategy = new_query_execution_strategy
1247
+ else
1248
+ @query_execution_strategy || find_inherited_value(:query_execution_strategy, self.default_execution_strategy)
1249
+ end
1250
+ end
1251
+
1252
+ def mutation_execution_strategy(new_mutation_execution_strategy = nil)
1253
+ if new_mutation_execution_strategy
1254
+ @mutation_execution_strategy = new_mutation_execution_strategy
1255
+ else
1256
+ @mutation_execution_strategy || find_inherited_value(:mutation_execution_strategy, self.default_execution_strategy)
1257
+ end
1258
+ end
1259
+
1260
+ def subscription_execution_strategy(new_subscription_execution_strategy = nil)
1261
+ if new_subscription_execution_strategy
1262
+ @subscription_execution_strategy = new_subscription_execution_strategy
1263
+ else
1264
+ @subscription_execution_strategy || find_inherited_value(:subscription_execution_strategy, self.default_execution_strategy)
1265
+ end
1266
+ end
1267
+
1268
+ attr_writer :validate_timeout
1269
+
1270
+ def validate_timeout(new_validate_timeout = nil)
1271
+ if new_validate_timeout
1272
+ @validate_timeout = new_validate_timeout
1273
+ elsif defined?(@validate_timeout)
1274
+ @validate_timeout
1275
+ else
1276
+ find_inherited_value(:validate_timeout)
1277
+ end
1278
+ end
1279
+
1280
+ # Validate a query string according to this schema.
1281
+ # @param string_or_document [String, GraphQL::Language::Nodes::Document]
1282
+ # @return [Array<GraphQL::StaticValidation::Error >]
1283
+ def validate(string_or_document, rules: nil, context: nil)
1284
+ doc = if string_or_document.is_a?(String)
1285
+ GraphQL.parse(string_or_document)
1286
+ else
1287
+ string_or_document
1288
+ end
1289
+ query = GraphQL::Query.new(self, document: doc, context: context)
1290
+ validator_opts = { schema: self }
1291
+ rules && (validator_opts[:rules] = rules)
1292
+ validator = GraphQL::StaticValidation::Validator.new(**validator_opts)
1293
+ res = validator.validate(query, timeout: validate_timeout)
1294
+ res[:errors]
1295
+ end
1296
+
1297
+ attr_writer :max_complexity
1298
+
781
1299
  def max_complexity(max_complexity = nil)
782
1300
  if max_complexity
783
1301
  @max_complexity = max_complexity
784
- else
1302
+ elsif defined?(@max_complexity)
785
1303
  @max_complexity
1304
+ else
1305
+ find_inherited_value(:max_complexity)
786
1306
  end
787
1307
  end
788
1308
 
1309
+ attr_writer :analysis_engine
1310
+
1311
+ def analysis_engine
1312
+ @analysis_engine || find_inherited_value(:analysis_engine, self.default_analysis_engine)
1313
+ end
1314
+
1315
+ def using_ast_analysis?
1316
+ analysis_engine == GraphQL::Analysis::AST
1317
+ end
1318
+
1319
+ def interpreter?
1320
+ query_execution_strategy == GraphQL::Execution::Interpreter &&
1321
+ mutation_execution_strategy == GraphQL::Execution::Interpreter &&
1322
+ subscription_execution_strategy == GraphQL::Execution::Interpreter
1323
+ end
1324
+
1325
+ attr_writer :interpreter
1326
+
1327
+ def error_bubbling(new_error_bubbling = nil)
1328
+ if !new_error_bubbling.nil?
1329
+ @error_bubbling = new_error_bubbling
1330
+ else
1331
+ @error_bubbling.nil? ? find_inherited_value(:error_bubbling) : @error_bubbling
1332
+ end
1333
+ end
1334
+
1335
+ attr_writer :error_bubbling
1336
+
1337
+ attr_writer :max_depth
1338
+
789
1339
  def max_depth(new_max_depth = nil)
790
1340
  if new_max_depth
791
1341
  @max_depth = new_max_depth
792
- else
1342
+ elsif defined?(@max_depth)
793
1343
  @max_depth
1344
+ else
1345
+ find_inherited_value(:max_depth)
1346
+ end
1347
+ end
1348
+
1349
+ def disable_introspection_entry_points
1350
+ @disable_introspection_entry_points = true
1351
+ # TODO: this clears the cache made in `def types`. But this is not a great solution.
1352
+ @introspection_system = nil
1353
+ end
1354
+
1355
+ def disable_schema_introspection_entry_point
1356
+ @disable_schema_introspection_entry_point = true
1357
+ # TODO: this clears the cache made in `def types`. But this is not a great solution.
1358
+ @introspection_system = nil
1359
+ end
1360
+
1361
+ def disable_type_introspection_entry_point
1362
+ @disable_type_introspection_entry_point = true
1363
+ # TODO: this clears the cache made in `def types`. But this is not a great solution.
1364
+ @introspection_system = nil
1365
+ end
1366
+
1367
+ def disable_introspection_entry_points?
1368
+ if instance_variable_defined?(:@disable_introspection_entry_points)
1369
+ @disable_introspection_entry_points
1370
+ else
1371
+ find_inherited_value(:disable_introspection_entry_points?, false)
1372
+ end
1373
+ end
1374
+
1375
+ def disable_schema_introspection_entry_point?
1376
+ if instance_variable_defined?(:@disable_schema_introspection_entry_point)
1377
+ @disable_schema_introspection_entry_point
1378
+ else
1379
+ find_inherited_value(:disable_schema_introspection_entry_point?, false)
1380
+ end
1381
+ end
1382
+
1383
+ def disable_type_introspection_entry_point?
1384
+ if instance_variable_defined?(:@disable_type_introspection_entry_point)
1385
+ @disable_type_introspection_entry_point
1386
+ else
1387
+ find_inherited_value(:disable_type_introspection_entry_point?, false)
794
1388
  end
795
1389
  end
796
1390
 
797
1391
  def orphan_types(*new_orphan_types)
798
1392
  if new_orphan_types.any?
799
- @orphan_types = new_orphan_types.flatten
800
- else
801
- @orphan_types || []
1393
+ new_orphan_types = new_orphan_types.flatten
1394
+ add_type_and_traverse(new_orphan_types, root: false)
1395
+ @orphan_types = new_orphan_types
1396
+ own_orphan_types.concat(new_orphan_types.flatten)
802
1397
  end
1398
+
1399
+ find_inherited_value(:orphan_types, EMPTY_ARRAY) + own_orphan_types
803
1400
  end
804
1401
 
805
1402
  def default_execution_strategy
806
1403
  if superclass <= GraphQL::Schema
807
1404
  superclass.default_execution_strategy
808
1405
  else
809
- @default_execution_strategy
1406
+ @default_execution_strategy ||= GraphQL::Execution::Interpreter
1407
+ end
1408
+ end
1409
+
1410
+ def default_analysis_engine
1411
+ if superclass <= GraphQL::Schema
1412
+ superclass.default_analysis_engine
1413
+ else
1414
+ @default_analysis_engine ||= GraphQL::Analysis::AST
810
1415
  end
811
1416
  end
812
1417
 
@@ -814,115 +1419,392 @@ module GraphQL
814
1419
  if new_context_class
815
1420
  @context_class = new_context_class
816
1421
  else
817
- @context_class || GraphQL::Query::Context
1422
+ @context_class || find_inherited_value(:context_class, GraphQL::Query::Context)
818
1423
  end
819
1424
  end
820
1425
 
821
- def rescue_from(err_class, &handler_block)
822
- @rescues ||= {}
823
- @rescues[err_class] = handler_block
1426
+ def rescue_from(*err_classes, &handler_block)
1427
+ err_classes.each do |err_class|
1428
+ error_handler.rescue_from(err_class, handler_block)
1429
+ end
1430
+ end
1431
+
1432
+ # rubocop:disable Lint/DuplicateMethods
1433
+ module ResolveTypeWithType
1434
+ def resolve_type(type, obj, ctx)
1435
+ first_resolved_type, resolved_value = if type.is_a?(Module) && type.respond_to?(:resolve_type)
1436
+ type.resolve_type(obj, ctx)
1437
+ else
1438
+ super
1439
+ end
1440
+
1441
+ after_lazy(first_resolved_type) do |resolved_type|
1442
+ if resolved_type.nil? || (resolved_type.is_a?(Module) && resolved_type.respond_to?(:kind)) || resolved_type.is_a?(GraphQL::BaseType)
1443
+ if resolved_value
1444
+ [resolved_type, resolved_value]
1445
+ else
1446
+ resolved_type
1447
+ end
1448
+ else
1449
+ raise ".resolve_type should return a type definition, but got #{resolved_type.inspect} (#{resolved_type.class}) from `resolve_type(#{type}, #{obj}, #{ctx})`"
1450
+ end
1451
+ end
1452
+ end
824
1453
  end
825
1454
 
826
1455
  def resolve_type(type, obj, ctx)
827
- raise NotImplementedError, "#{self.name}.resolve_type(type, obj, ctx) must be implemented to use Union types or Interface types (tried to resolve: #{type.name})"
1456
+ if type.kind.object?
1457
+ type
1458
+ else
1459
+ raise GraphQL::RequiredImplementationMissingError, "#{self.name}.resolve_type(type, obj, ctx) must be implemented to use Union types or Interface types (tried to resolve: #{type.name})"
1460
+ end
1461
+ end
1462
+ # rubocop:enable Lint/DuplicateMethods
1463
+
1464
+ def inherited(child_class)
1465
+ if self == GraphQL::Schema
1466
+ child_class.directives(default_directives.values)
1467
+ end
1468
+ child_class.singleton_class.prepend(ResolveTypeWithType)
1469
+ super
828
1470
  end
829
1471
 
830
1472
  def object_from_id(node_id, ctx)
831
- raise NotImplementedError, "#{self.name}.object_from_id(node_id, ctx) must be implemented to use the `node` field (tried to load from id `#{node_id}`)"
1473
+ raise GraphQL::RequiredImplementationMissingError, "#{self.name}.object_from_id(node_id, ctx) must be implemented to load by ID (tried to load from id `#{node_id}`)"
832
1474
  end
833
1475
 
834
1476
  def id_from_object(object, type, ctx)
835
- raise NotImplementedError, "#{self.name}.id_from_object(object, type, ctx) must be implemented to create global ids (tried to create an id for `#{object.inspect}`)"
1477
+ raise GraphQL::RequiredImplementationMissingError, "#{self.name}.id_from_object(object, type, ctx) must be implemented to create global ids (tried to create an id for `#{object.inspect}`)"
1478
+ end
1479
+
1480
+ def visible?(member, ctx)
1481
+ member.type_class.visible?(ctx)
1482
+ end
1483
+
1484
+ def accessible?(member, ctx)
1485
+ member.type_class.accessible?(ctx)
1486
+ end
1487
+
1488
+ # This hook is called when a client tries to access one or more
1489
+ # fields that fail the `accessible?` check.
1490
+ #
1491
+ # By default, an error is added to the response. Override this hook to
1492
+ # track metrics or return a different error to the client.
1493
+ #
1494
+ # @param error [InaccessibleFieldsError] The analysis error for this check
1495
+ # @return [AnalysisError, nil] Return an error to skip the query
1496
+ def inaccessible_fields(error)
1497
+ error
1498
+ end
1499
+
1500
+ # This hook is called when an object fails an `authorized?` check.
1501
+ # You might report to your bug tracker here, so you can correct
1502
+ # the field resolvers not to return unauthorized objects.
1503
+ #
1504
+ # By default, this hook just replaces the unauthorized object with `nil`.
1505
+ #
1506
+ # Whatever value is returned from this method will be used instead of the
1507
+ # unauthorized object (accessible as `unauthorized_error.object`). If an
1508
+ # error is raised, then `nil` will be used.
1509
+ #
1510
+ # If you want to add an error to the `"errors"` key, raise a {GraphQL::ExecutionError}
1511
+ # in this hook.
1512
+ #
1513
+ # @param unauthorized_error [GraphQL::UnauthorizedError]
1514
+ # @return [Object] The returned object will be put in the GraphQL response
1515
+ def unauthorized_object(unauthorized_error)
1516
+ nil
1517
+ end
1518
+
1519
+ # This hook is called when a field fails an `authorized?` check.
1520
+ #
1521
+ # By default, this hook implements the same behavior as unauthorized_object.
1522
+ #
1523
+ # Whatever value is returned from this method will be used instead of the
1524
+ # unauthorized field . If an error is raised, then `nil` will be used.
1525
+ #
1526
+ # If you want to add an error to the `"errors"` key, raise a {GraphQL::ExecutionError}
1527
+ # in this hook.
1528
+ #
1529
+ # @param unauthorized_error [GraphQL::UnauthorizedFieldError]
1530
+ # @return [Field] The returned field will be put in the GraphQL response
1531
+ def unauthorized_field(unauthorized_error)
1532
+ unauthorized_object(unauthorized_error)
836
1533
  end
837
1534
 
838
1535
  def type_error(type_err, ctx)
839
1536
  DefaultTypeError.call(type_err, ctx)
840
1537
  end
841
1538
 
1539
+ # A function to call when {#execute} receives an invalid query string
1540
+ #
1541
+ # The default is to add the error to `context.errors`
1542
+ # @param err [GraphQL::ParseError] The error encountered during parsing
1543
+ # @param ctx [GraphQL::Query::Context] The context for the query where the error occurred
1544
+ # @return void
1545
+ def parse_error(parse_err, ctx)
1546
+ ctx.errors.push(parse_err)
1547
+ end
1548
+
1549
+ # @return [GraphQL::Execution::Errors]
1550
+ def error_handler
1551
+ @error_handler ||= GraphQL::Execution::Errors.new(self)
1552
+ end
1553
+
842
1554
  def lazy_resolve(lazy_class, value_method)
843
- lazy_classes[lazy_class] = value_method
1555
+ lazy_methods.set(lazy_class, value_method)
844
1556
  end
845
1557
 
846
1558
  def instrument(instrument_step, instrumenter, options = {})
1559
+ if instrument_step == :field
1560
+ GraphQL::Deprecation.warn "Field instrumentation (#{instrumenter.inspect}) will be removed in GraphQL-Ruby 2.0, please upgrade to field extensions: https://graphql-ruby.org/type_definitions/field_extensions.html"
1561
+ end
1562
+
847
1563
  step = if instrument_step == :field && options[:after_built_ins]
848
1564
  :field_after_built_ins
849
1565
  else
850
1566
  instrument_step
851
1567
  end
852
- defined_instrumenters[step] << instrumenter
1568
+
1569
+ own_instrumenters[step] << instrumenter
853
1570
  end
854
1571
 
855
- def directives(new_directives = nil)
856
- if new_directives
857
- @directives = new_directives.reduce({}) { |m, d| m[d.name] = d; m }
1572
+ # Add several directives at once
1573
+ # @param new_directives [Class]
1574
+ def directives(*new_directives)
1575
+ if new_directives.any?
1576
+ new_directives.flatten.each { |d| directive(d) }
858
1577
  end
859
1578
 
860
- @directives ||= directives(DIRECTIVES)
1579
+ find_inherited_value(:directives, default_directives).merge(own_directives)
1580
+ end
1581
+
1582
+ # Attach a single directive to this schema
1583
+ # @param new_directive [Class]
1584
+ # @return void
1585
+ def directive(new_directive)
1586
+ add_type_and_traverse(new_directive, root: false)
1587
+ end
1588
+
1589
+ def default_directives
1590
+ @default_directives ||= {
1591
+ "include" => GraphQL::Schema::Directive::Include,
1592
+ "skip" => GraphQL::Schema::Directive::Skip,
1593
+ "deprecated" => GraphQL::Schema::Directive::Deprecated,
1594
+ }.freeze
861
1595
  end
862
1596
 
863
1597
  def tracer(new_tracer)
864
- defined_tracers << new_tracer
1598
+ own_tracers << new_tracer
1599
+ end
1600
+
1601
+ def tracers
1602
+ find_inherited_value(:tracers, EMPTY_ARRAY) + own_tracers
865
1603
  end
866
1604
 
867
1605
  def query_analyzer(new_analyzer)
868
- defined_query_analyzers << new_analyzer
1606
+ if new_analyzer == GraphQL::Authorization::Analyzer
1607
+ GraphQL::Deprecation.warn("The Authorization query analyzer is deprecated. Authorizing at query runtime is generally a better idea.")
1608
+ end
1609
+ own_query_analyzers << new_analyzer
1610
+ end
1611
+
1612
+ def query_analyzers
1613
+ find_inherited_value(:query_analyzers, EMPTY_ARRAY) + own_query_analyzers
869
1614
  end
870
1615
 
871
1616
  def middleware(new_middleware = nil)
872
1617
  if new_middleware
873
- defined_middleware << new_middleware
1618
+ GraphQL::Deprecation.warn "Middleware will be removed in GraphQL-Ruby 2.0, please upgrade to Field Extensions: https://graphql-ruby.org/type_definitions/field_extensions.html"
1619
+ own_middleware << new_middleware
874
1620
  else
875
- graphql_definition.middleware
1621
+ # TODO make sure this is cached when running a query
1622
+ MiddlewareChain.new(steps: all_middleware, final_step: GraphQL::Execution::Execute::FieldResolveStep)
876
1623
  end
877
1624
  end
878
1625
 
879
1626
  def multiplex_analyzer(new_analyzer)
880
- defined_multiplex_analyzers << new_analyzer
1627
+ own_multiplex_analyzers << new_analyzer
1628
+ end
1629
+
1630
+ def multiplex_analyzers
1631
+ find_inherited_value(:multiplex_analyzers, EMPTY_ARRAY) + own_multiplex_analyzers
1632
+ end
1633
+
1634
+ # Execute a query on itself.
1635
+ # @see {Query#initialize} for arguments.
1636
+ # @return [Hash] query result, ready to be serialized as JSON
1637
+ def execute(query_str = nil, **kwargs)
1638
+ if query_str
1639
+ kwargs[:query] = query_str
1640
+ end
1641
+ # Some of the query context _should_ be passed to the multiplex, too
1642
+ multiplex_context = if (ctx = kwargs[:context])
1643
+ {
1644
+ backtrace: ctx[:backtrace],
1645
+ tracers: ctx[:tracers],
1646
+ }
1647
+ else
1648
+ {}
1649
+ end
1650
+ # Since we're running one query, don't run a multiplex-level complexity analyzer
1651
+ all_results = multiplex([kwargs], max_complexity: nil, context: multiplex_context)
1652
+ all_results[0]
1653
+ end
1654
+
1655
+ # Execute several queries on itself, concurrently.
1656
+ #
1657
+ # @example Run several queries at once
1658
+ # context = { ... }
1659
+ # queries = [
1660
+ # { query: params[:query_1], variables: params[:variables_1], context: context },
1661
+ # { query: params[:query_2], variables: params[:variables_2], context: context },
1662
+ # ]
1663
+ # results = MySchema.multiplex(queries)
1664
+ # render json: {
1665
+ # result_1: results[0],
1666
+ # result_2: results[1],
1667
+ # }
1668
+ #
1669
+ # @see {Query#initialize} for query keyword arguments
1670
+ # @see {Execution::Multiplex#run_queries} for multiplex keyword arguments
1671
+ # @param queries [Array<Hash>] Keyword arguments for each query
1672
+ # @param context [Hash] Multiplex-level context
1673
+ # @return [Array<Hash>] One result for each query in the input
1674
+ def multiplex(queries, **kwargs)
1675
+ schema = if interpreter?
1676
+ self
1677
+ else
1678
+ graphql_definition
1679
+ end
1680
+ GraphQL::Execution::Multiplex.run_all(schema, queries, **kwargs)
1681
+ end
1682
+
1683
+ def instrumenters
1684
+ inherited_instrumenters = find_inherited_value(:instrumenters) || Hash.new { |h,k| h[k] = [] }
1685
+ inherited_instrumenters.merge(own_instrumenters) do |_step, inherited, own|
1686
+ inherited + own
1687
+ end
1688
+ end
1689
+
1690
+ # @api private
1691
+ def add_subscription_extension_if_necessary
1692
+ if interpreter? && !defined?(@subscription_extension_added) && subscription && self.subscriptions
1693
+ @subscription_extension_added = true
1694
+ if subscription.singleton_class.ancestors.include?(Subscriptions::SubscriptionRoot)
1695
+ GraphQL::Deprecation.warn("`extend Subscriptions::SubscriptionRoot` is no longer required; you may remove it from #{self}'s `subscription` root type (#{subscription}).")
1696
+ else
1697
+ subscription.fields.each do |name, field|
1698
+ field.extension(Subscriptions::DefaultSubscriptionResolveExtension)
1699
+ end
1700
+ end
1701
+ end
1702
+ end
1703
+
1704
+ def query_stack_error(query, err)
1705
+ query.context.errors.push(GraphQL::ExecutionError.new("This query is too large to execute."))
881
1706
  end
882
1707
 
883
1708
  private
884
1709
 
885
- def lazy_classes
886
- @lazy_classes ||= {}
1710
+ # @param t [Module, Array<Module>]
1711
+ # @return [void]
1712
+ def add_type_and_traverse(t, root:)
1713
+ if root
1714
+ @root_types ||= []
1715
+ @root_types << t
1716
+ end
1717
+ new_types = Array(t)
1718
+ addition = Schema::Addition.new(schema: self, own_types: own_types, new_types: new_types)
1719
+ own_types.merge!(addition.types)
1720
+ own_possible_types.merge!(addition.possible_types) { |key, old_val, new_val| old_val + new_val }
1721
+ own_union_memberships.merge!(addition.union_memberships)
1722
+
1723
+ addition.references.each { |thing, pointers|
1724
+ pointers.each { |pointer| references_to(thing, from: pointer) }
1725
+ }
1726
+
1727
+ addition.directives.each { |dir_class| own_directives[dir_class.graphql_name] = dir_class }
1728
+
1729
+ addition.arguments_with_default_values.each do |arg|
1730
+ arg.validate_default_value
1731
+ end
887
1732
  end
888
1733
 
889
- def defined_instrumenters
890
- @defined_instrumenters ||= Hash.new { |h,k| h[k] = [] }
1734
+ def lazy_methods
1735
+ if !defined?(@lazy_methods)
1736
+ if inherited_map = find_inherited_value(:lazy_methods)
1737
+ # this isn't _completely_ inherited :S (Things added after `dup` won't work)
1738
+ @lazy_methods = inherited_map.dup
1739
+ else
1740
+ @lazy_methods = GraphQL::Execution::Lazy::LazyMethodMap.new
1741
+ @lazy_methods.set(GraphQL::Execution::Lazy, :value)
1742
+ @lazy_methods.set(GraphQL::Dataloader::Request, :load)
1743
+ end
1744
+ end
1745
+ @lazy_methods
891
1746
  end
892
1747
 
893
- def defined_tracers
894
- @defined_tracers ||= []
1748
+ def own_types
1749
+ @own_types ||= {}
895
1750
  end
896
1751
 
897
- def defined_query_analyzers
898
- @defined_query_analyzers ||= []
1752
+ def non_introspection_types
1753
+ find_inherited_value(:non_introspection_types, EMPTY_HASH).merge(own_types)
899
1754
  end
900
1755
 
901
- def defined_middleware
902
- @defined_middleware ||= []
1756
+ def own_plugins
1757
+ @own_plugins ||= []
903
1758
  end
904
1759
 
905
- def defined_multiplex_analyzers
906
- @defined_multiplex_analyzers ||= []
1760
+ def own_orphan_types
1761
+ @own_orphan_types ||= []
907
1762
  end
908
- end
909
1763
 
1764
+ def own_possible_types
1765
+ @own_possible_types ||= {}
1766
+ end
910
1767
 
911
- def self.inherited(child_class)
912
- child_class.singleton_class.class_eval do
913
- prepend(MethodWrappers)
1768
+ def own_union_memberships
1769
+ @own_union_memberships ||= {}
914
1770
  end
915
- end
916
1771
 
917
- module MethodWrappers
918
- # Wrap the user-provided resolve-type in a correctness check
919
- def resolve_type(type, obj, ctx = :__undefined__)
920
- graphql_definition.check_resolved_type(type, obj, ctx) do |ok_type, ok_obj, ok_ctx|
921
- super(ok_type, ok_obj, ok_ctx)
922
- end
1772
+ def own_directives
1773
+ @own_directives ||= {}
1774
+ end
1775
+
1776
+ def own_instrumenters
1777
+ @own_instrumenters ||= Hash.new { |h,k| h[k] = [] }
1778
+ end
1779
+
1780
+ def own_tracers
1781
+ @own_tracers ||= []
1782
+ end
1783
+
1784
+ def own_query_analyzers
1785
+ @defined_query_analyzers ||= []
1786
+ end
1787
+
1788
+ def all_middleware
1789
+ find_inherited_value(:all_middleware, EMPTY_ARRAY) + own_middleware
1790
+ end
1791
+
1792
+ def own_middleware
1793
+ @own_middleware ||= []
1794
+ end
1795
+
1796
+ def own_multiplex_analyzers
1797
+ @own_multiplex_analyzers ||= []
923
1798
  end
924
1799
  end
925
1800
 
1801
+ def dataloader_class
1802
+ self.class.dataloader_class
1803
+ end
1804
+
1805
+ # Install these here so that subclasses will also install it.
1806
+ use(GraphQL::Pagination::Connections)
1807
+
926
1808
  protected
927
1809
 
928
1810
  def rescues?
@@ -937,15 +1819,6 @@ module GraphQL
937
1819
 
938
1820
  private
939
1821
 
940
- # Wrap Relay-related objects in wrappers
941
- # @api private
942
- BUILT_IN_INSTRUMENTERS = [
943
- GraphQL::Relay::ConnectionInstrumentation,
944
- GraphQL::Relay::EdgesInstrumentation,
945
- GraphQL::Relay::Mutation::Instrumentation,
946
- GraphQL::Schema::Member::Instrumentation,
947
- ]
948
-
949
1822
  def rebuild_artifacts
950
1823
  if @rebuilding_artifacts
951
1824
  raise CyclicalDefinitionError, "Part of the schema build process re-triggered the schema build process, causing an infinite loop. Avoid using Schema#types, Schema#possible_types, and Schema#get_field during schema build."