graphql 1.10.14 → 1.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/core.rb +8 -0
  3. data/lib/generators/graphql/templates/base_argument.erb +2 -0
  4. data/lib/generators/graphql/templates/base_enum.erb +2 -0
  5. data/lib/generators/graphql/templates/base_field.erb +2 -0
  6. data/lib/generators/graphql/templates/base_input_object.erb +2 -0
  7. data/lib/generators/graphql/templates/base_interface.erb +2 -0
  8. data/lib/generators/graphql/templates/base_mutation.erb +2 -0
  9. data/lib/generators/graphql/templates/base_object.erb +2 -0
  10. data/lib/generators/graphql/templates/base_scalar.erb +2 -0
  11. data/lib/generators/graphql/templates/base_union.erb +2 -0
  12. data/lib/generators/graphql/templates/enum.erb +2 -0
  13. data/lib/generators/graphql/templates/graphql_controller.erb +13 -9
  14. data/lib/generators/graphql/templates/interface.erb +2 -0
  15. data/lib/generators/graphql/templates/loader.erb +2 -0
  16. data/lib/generators/graphql/templates/mutation.erb +2 -0
  17. data/lib/generators/graphql/templates/mutation_type.erb +2 -0
  18. data/lib/generators/graphql/templates/object.erb +2 -0
  19. data/lib/generators/graphql/templates/query_type.erb +2 -0
  20. data/lib/generators/graphql/templates/scalar.erb +2 -0
  21. data/lib/generators/graphql/templates/schema.erb +2 -0
  22. data/lib/generators/graphql/templates/union.erb +2 -0
  23. data/lib/graphql.rb +3 -3
  24. data/lib/graphql/execution/interpreter.rb +1 -1
  25. data/lib/graphql/execution/interpreter/runtime.rb +26 -26
  26. data/lib/graphql/execution/multiplex.rb +1 -2
  27. data/lib/graphql/introspection/schema_type.rb +3 -3
  28. data/lib/graphql/invalid_null_error.rb +18 -0
  29. data/lib/graphql/language/nodes.rb +1 -0
  30. data/lib/graphql/language/visitor.rb +2 -2
  31. data/lib/graphql/pagination/connection.rb +18 -13
  32. data/lib/graphql/pagination/connections.rb +17 -4
  33. data/lib/graphql/query.rb +1 -2
  34. data/lib/graphql/query/context.rb +20 -1
  35. data/lib/graphql/query/fingerprint.rb +2 -0
  36. data/lib/graphql/query/validation_pipeline.rb +3 -0
  37. data/lib/graphql/schema.rb +26 -16
  38. data/lib/graphql/schema/build_from_definition.rb +7 -12
  39. data/lib/graphql/schema/build_from_definition/resolve_map.rb +3 -1
  40. data/lib/graphql/schema/enum_value.rb +1 -0
  41. data/lib/graphql/schema/field.rb +63 -77
  42. data/lib/graphql/schema/field/connection_extension.rb +42 -32
  43. data/lib/graphql/schema/loader.rb +19 -1
  44. data/lib/graphql/schema/member/has_fields.rb +15 -5
  45. data/lib/graphql/schema/mutation.rb +4 -0
  46. data/lib/graphql/schema/object.rb +1 -1
  47. data/lib/graphql/schema/resolver.rb +20 -0
  48. data/lib/graphql/schema/resolver/has_payload_type.rb +2 -1
  49. data/lib/graphql/schema/subscription.rb +3 -13
  50. data/lib/graphql/schema/union.rb +29 -0
  51. data/lib/graphql/schema/warden.rb +2 -4
  52. data/lib/graphql/static_validation/rules/variables_are_used_and_defined.rb +4 -2
  53. data/lib/graphql/subscriptions.rb +69 -24
  54. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +66 -11
  55. data/lib/graphql/subscriptions/broadcast_analyzer.rb +84 -0
  56. data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +21 -0
  57. data/lib/graphql/subscriptions/event.rb +16 -1
  58. data/lib/graphql/subscriptions/serialize.rb +22 -4
  59. data/lib/graphql/subscriptions/subscription_root.rb +3 -1
  60. data/lib/graphql/tracing.rb +1 -27
  61. data/lib/graphql/tracing/appoptics_tracing.rb +10 -2
  62. data/lib/graphql/tracing/platform_tracing.rb +25 -15
  63. data/lib/graphql/tracing/statsd_tracing.rb +42 -0
  64. data/lib/graphql/types/iso_8601_date_time.rb +2 -1
  65. data/lib/graphql/types/relay/base_connection.rb +6 -5
  66. data/lib/graphql/version.rb +1 -1
  67. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1d76918804bdeeba0c80bbcfcdde70d04132110aee8e4520dcba8480da390fc
4
- data.tar.gz: c0e1954ae3f6d18bf03fc33807b94d482b83b4e4a6f8a392452e2f6e8297f241
3
+ metadata.gz: c5bf42de25927dab863bd600879d33d204c54bdf124b2b4cc5b27c4c16d4f28b
4
+ data.tar.gz: 58b21a4dd5ba80ec0f6c3362013a6adb07c2f1af243e5a851d4c3f08554fe09d
5
5
  SHA512:
6
- metadata.gz: 3e945033f8657c252fcd99a18d4be5c9d267535753e88a94f3b589c968ca186e90f3368768ff2f3f7c7e1eff7a210bf57694bde763255ee0a91f1e46534b0b4d
7
- data.tar.gz: de56338439eeb22b8484033c5acfb4ac027edee60ac30218c8a7516c5bc6d4bfa07b8be54ebd42a63fca5decdfbbcf85e4b96832bb8d7fcd304dc2fb98bc7625
6
+ metadata.gz: f199d24a190910e44b189340b6a3d2a3c121ab56ba10ec6cf44d8801107db8d73541f24788b00b13ee7dd357f7bfe6ecff7001f053fe417c777bca59db5851db
7
+ data.tar.gz: fd0955c7f67b20370ea376d6a286fdf0ac7272ac5b243d6c309d2159a780cd0b8f92fd0e06ca312a69a16b7c8ad0ebd7bb4587feac9dc77b27da507c9a44cd8f
@@ -41,6 +41,14 @@ module Graphql
41
41
  end
42
42
  end
43
43
 
44
+ def module_namespacing_when_supported
45
+ if defined?(module_namespacing)
46
+ module_namespacing { yield }
47
+ else
48
+ yield
49
+ end
50
+ end
51
+
44
52
  private
45
53
 
46
54
  def schema_name
@@ -1,4 +1,6 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseArgument < GraphQL::Schema::Argument
3
4
  end
4
5
  end
6
+ <% end -%>
@@ -1,4 +1,6 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseEnum < GraphQL::Schema::Enum
3
4
  end
4
5
  end
6
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseField < GraphQL::Schema::Field
3
4
  argument_class Types::BaseArgument
4
5
  end
5
6
  end
7
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseInputObject < GraphQL::Schema::InputObject
3
4
  argument_class Types::BaseArgument
4
5
  end
5
6
  end
7
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  module BaseInterface
3
4
  include GraphQL::Schema::Interface
@@ -5,3 +6,4 @@ module Types
5
6
  field_class Types::BaseField
6
7
  end
7
8
  end
9
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Mutations
2
3
  class BaseMutation < GraphQL::Schema::RelayClassicMutation
3
4
  argument_class Types::BaseArgument
@@ -6,3 +7,4 @@ module Mutations
6
7
  object_class Types::BaseObject
7
8
  end
8
9
  end
10
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseObject < GraphQL::Schema::Object
3
4
  field_class Types::BaseField
4
5
  end
5
6
  end
7
+ <% end -%>
@@ -1,4 +1,6 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseScalar < GraphQL::Schema::Scalar
3
4
  end
4
5
  end
6
+ <% end -%>
@@ -1,4 +1,6 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class BaseUnion < GraphQL::Schema::Union
3
4
  end
4
5
  end
6
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class <%= type_ruby_name.split('::')[-1] %> < Types::BaseEnum
3
4
  <% prepared_values.each do |v| %> value "<%= v[0] %>"<%= v.length > 1 ? ", value: #{v[1]}" : "" %>
4
5
  <% end %> end
5
6
  end
7
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  class GraphqlController < ApplicationController
2
3
  # If accessing from outside this domain, nullify the session
3
4
  # This allows for outside API access while preventing CSRF attacks,
@@ -5,7 +6,7 @@ class GraphqlController < ApplicationController
5
6
  # protect_from_forgery with: :null_session
6
7
 
7
8
  def execute
8
- variables = ensure_hash(params[:variables])
9
+ variables = prepare_variables(params[:variables])
9
10
  query = params[:query]
10
11
  operation_name = params[:operationName]
11
12
  context = {
@@ -21,21 +22,23 @@ class GraphqlController < ApplicationController
21
22
 
22
23
  private
23
24
 
24
- # Handle form data, JSON body, or a blank value
25
- def ensure_hash(ambiguous_param)
26
- case ambiguous_param
25
+ # Handle variables in form data, JSON body, or a blank value
26
+ def prepare_variables(variables_param)
27
+ case variables_param
27
28
  when String
28
- if ambiguous_param.present?
29
- ensure_hash(JSON.parse(ambiguous_param))
29
+ if variables_param.present?
30
+ JSON.parse(variables_param) || {}
30
31
  else
31
32
  {}
32
33
  end
33
- when Hash, ActionController::Parameters
34
- ambiguous_param
34
+ when Hash
35
+ variables_param
36
+ when ActionController::Parameters
37
+ variables_param.to_unsafe_hash # GraphQL-Ruby will validate name and type of incoming variables.
35
38
  when nil
36
39
  {}
37
40
  else
38
- raise ArgumentError, "Unexpected parameter: #{ambiguous_param}"
41
+ raise ArgumentError, "Unexpected parameter: #{variables_param}"
39
42
  end
40
43
  end
41
44
 
@@ -46,3 +49,4 @@ class GraphqlController < ApplicationController
46
49
  render json: { errors: [{ message: e.message, backtrace: e.backtrace }], data: {} }, status: 500
47
50
  end
48
51
  end
52
+ <% end -%>
@@ -1,6 +1,8 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  module <%= type_ruby_name.split('::')[-1] %>
3
4
  include Types::BaseInterface
4
5
  <% normalized_fields.each do |f| %> <%= f.to_ruby %>
5
6
  <% end %> end
6
7
  end
8
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Loaders
2
3
  class <%= class_name %> < GraphQL::Batch::Loader
3
4
  # Define `initialize` to store grouping arguments, eg
@@ -15,3 +16,4 @@ module Loaders
15
16
  end
16
17
  end
17
18
  end
19
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Mutations
2
3
  class <%= mutation_name %> < BaseMutation
3
4
  # TODO: define return fields
@@ -12,3 +13,4 @@ module Mutations
12
13
  # end
13
14
  end
14
15
  end
16
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class MutationType < Types::BaseObject
3
4
  # TODO: remove me
@@ -8,3 +9,4 @@ module Types
8
9
  end
9
10
  end
10
11
  end
12
+ <% end -%>
@@ -1,6 +1,8 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class <%= type_ruby_name.split('::')[-1] %> < Types::BaseObject
3
4
  <% if options.node %> implements GraphQL::Relay::Node.interface
4
5
  <% end %><% normalized_fields.each do |f| %> <%= f.to_ruby %>
5
6
  <% end %> end
6
7
  end
8
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class QueryType < Types::BaseObject
3
4
  # Add root-level fields here.
@@ -13,3 +14,4 @@ module Types
13
14
  field :node, field: GraphQL::Relay::Node.field
14
15
  <% end %> end
15
16
  end
17
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class <%= type_ruby_name.split('::')[-1] %> < Types::BaseScalar
3
4
  def self.coerce_input(input_value, context)
@@ -11,3 +12,4 @@ module Types
11
12
  end
12
13
  end
13
14
  end
15
+ <% end -%>
@@ -1,3 +1,4 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  class <%= schema_name %> < GraphQL::Schema
2
3
  query(Types::QueryType)
3
4
 
@@ -38,3 +39,4 @@ class <%= schema_name %> < GraphQL::Schema
38
39
  # GraphQL::Batch setup:
39
40
  use GraphQL::Batch
40
41
  <% end %>end
42
+ <% end -%>
@@ -1,5 +1,7 @@
1
+ <% module_namespacing_when_supported do -%>
1
2
  module Types
2
3
  class <%= type_ruby_name.split('::')[-1] %> < Types::BaseUnion
3
4
  <% if possible_types.any? %> possible_types [<%= normalized_possible_types.join(", ") %>]
4
5
  <% end %> end
5
6
  end
7
+ <% end -%>
@@ -91,13 +91,13 @@ require "graphql/analysis"
91
91
  require "graphql/tracing"
92
92
  require "graphql/dig"
93
93
  require "graphql/execution"
94
+ require "graphql/runtime_type_error"
95
+ require "graphql/unresolved_type_error"
96
+ require "graphql/invalid_null_error"
94
97
  require "graphql/schema"
95
98
  require "graphql/query"
96
99
  require "graphql/directive"
97
100
  require "graphql/execution"
98
- require "graphql/runtime_type_error"
99
- require "graphql/unresolved_type_error"
100
- require "graphql/invalid_null_error"
101
101
  require "graphql/types"
102
102
  require "graphql/relay"
103
103
  require "graphql/boolean_type"
@@ -26,7 +26,7 @@ module GraphQL
26
26
  schema_class.query_execution_strategy(GraphQL::Execution::Interpreter)
27
27
  schema_class.mutation_execution_strategy(GraphQL::Execution::Interpreter)
28
28
  schema_class.subscription_execution_strategy(GraphQL::Execution::Interpreter)
29
-
29
+ schema_class.add_subscription_extension_if_necessary
30
30
  GraphQL::Schema::Object.include(HandlesRawValue)
31
31
  end
32
32
 
@@ -170,13 +170,13 @@ module GraphQL
170
170
  begin
171
171
  kwarg_arguments = arguments(object, field_defn, ast_node)
172
172
  rescue GraphQL::ExecutionError => e
173
- continue_value(next_path, e, field_defn, return_type.non_null?, ast_node)
173
+ continue_value(next_path, e, owner_type, field_defn, return_type.non_null?, ast_node)
174
174
  next
175
175
  end
176
176
 
177
177
  after_lazy(kwarg_arguments, owner: owner_type, field: field_defn, path: next_path, scoped_context: context.scoped_context, owner_object: object, arguments: kwarg_arguments) do |resolved_arguments|
178
178
  if resolved_arguments.is_a? GraphQL::ExecutionError
179
- continue_value(next_path, resolved_arguments, field_defn, return_type.non_null?, ast_node)
179
+ continue_value(next_path, resolved_arguments, owner_type, field_defn, return_type.non_null?, ast_node)
180
180
  next
181
181
  end
182
182
 
@@ -228,12 +228,12 @@ module GraphQL
228
228
  err
229
229
  end
230
230
  after_lazy(app_result, owner: owner_type, field: field_defn, path: next_path, scoped_context: context.scoped_context, owner_object: object, arguments: kwarg_arguments) do |inner_result|
231
- continue_value = continue_value(next_path, inner_result, field_defn, return_type.non_null?, ast_node)
231
+ continue_value = continue_value(next_path, inner_result, owner_type, field_defn, return_type.non_null?, ast_node)
232
232
  if RawValue === continue_value
233
233
  # Write raw value directly to the response without resolving nested objects
234
234
  write_in_response(next_path, continue_value.resolve)
235
235
  elsif HALT != continue_value
236
- continue_field(next_path, continue_value, field_defn, return_type, ast_node, next_selections, false, object, kwarg_arguments)
236
+ continue_field(next_path, continue_value, owner_type, field_defn, return_type, ast_node, next_selections, false, object, kwarg_arguments)
237
237
  end
238
238
  end
239
239
  end
@@ -251,10 +251,10 @@ module GraphQL
251
251
  end
252
252
 
253
253
  HALT = Object.new
254
- def continue_value(path, value, field, is_non_null, ast_node)
254
+ def continue_value(path, value, parent_type, field, is_non_null, ast_node)
255
255
  if value.nil?
256
256
  if is_non_null
257
- err = field.owner::InvalidNullError.new(field.owner, field, value)
257
+ err = parent_type::InvalidNullError.new(parent_type, field, value)
258
258
  write_invalid_null_in_response(path, err)
259
259
  else
260
260
  write_in_response(path, nil)
@@ -281,7 +281,7 @@ module GraphQL
281
281
  err
282
282
  end
283
283
 
284
- continue_value(path, next_value, field, is_non_null, ast_node)
284
+ continue_value(path, next_value, parent_type, field, is_non_null, ast_node)
285
285
  elsif GraphQL::Execution::Execute::SKIP == value
286
286
  HALT
287
287
  else
@@ -297,49 +297,49 @@ module GraphQL
297
297
  # Location information from `path` and `ast_node`.
298
298
  #
299
299
  # @return [Lazy, Array, Hash, Object] Lazy, Array, and Hash are all traversed to resolve lazy values later
300
- def continue_field(path, value, field, type, ast_node, next_selections, is_non_null, owner_object, arguments) # rubocop:disable Metrics/ParameterLists
301
- case type.kind.name
300
+ def continue_field(path, value, owner_type, field, current_type, ast_node, next_selections, is_non_null, owner_object, arguments) # rubocop:disable Metrics/ParameterLists
301
+ case current_type.kind.name
302
302
  when "SCALAR", "ENUM"
303
- r = type.coerce_result(value, context)
303
+ r = current_type.coerce_result(value, context)
304
304
  write_in_response(path, r)
305
305
  r
306
306
  when "UNION", "INTERFACE"
307
- resolved_type_or_lazy, resolved_value = resolve_type(type, value, path)
307
+ resolved_type_or_lazy, resolved_value = resolve_type(current_type, value, path)
308
308
  resolved_value ||= value
309
309
 
310
- after_lazy(resolved_type_or_lazy, owner: type, path: path, scoped_context: context.scoped_context, field: field, owner_object: owner_object, arguments: arguments, trace: false) do |resolved_type|
311
- possible_types = query.possible_types(type)
310
+ after_lazy(resolved_type_or_lazy, owner: current_type, path: path, scoped_context: context.scoped_context, field: field, owner_object: owner_object, arguments: arguments, trace: false) do |resolved_type|
311
+ possible_types = query.possible_types(current_type)
312
312
 
313
313
  if !possible_types.include?(resolved_type)
314
- parent_type = field.owner
315
- err_class = type::UnresolvedTypeError
314
+ parent_type = field.owner_type
315
+ err_class = current_type::UnresolvedTypeError
316
316
  type_error = err_class.new(resolved_value, field, parent_type, resolved_type, possible_types)
317
317
  schema.type_error(type_error, context)
318
318
  write_in_response(path, nil)
319
319
  nil
320
320
  else
321
- continue_field(path, resolved_value, field, resolved_type, ast_node, next_selections, is_non_null, owner_object, arguments)
321
+ continue_field(path, resolved_value, owner_type, field, resolved_type, ast_node, next_selections, is_non_null, owner_object, arguments)
322
322
  end
323
323
  end
324
324
  when "OBJECT"
325
325
  object_proxy = begin
326
- authorized_new(type, value, context, path)
326
+ authorized_new(current_type, value, context, path)
327
327
  rescue GraphQL::ExecutionError => err
328
328
  err
329
329
  end
330
- after_lazy(object_proxy, owner: type, path: path, scoped_context: context.scoped_context, field: field, owner_object: owner_object, arguments: arguments, trace: false) do |inner_object|
331
- continue_value = continue_value(path, inner_object, field, is_non_null, ast_node)
330
+ after_lazy(object_proxy, owner: current_type, path: path, scoped_context: context.scoped_context, field: field, owner_object: owner_object, arguments: arguments, trace: false) do |inner_object|
331
+ continue_value = continue_value(path, inner_object, owner_type, field, is_non_null, ast_node)
332
332
  if HALT != continue_value
333
333
  response_hash = {}
334
334
  write_in_response(path, response_hash)
335
- evaluate_selections(path, context.scoped_context, continue_value, type, next_selections)
335
+ evaluate_selections(path, context.scoped_context, continue_value, current_type, next_selections)
336
336
  response_hash
337
337
  end
338
338
  end
339
339
  when "LIST"
340
340
  response_list = []
341
341
  write_in_response(path, response_list)
342
- inner_type = type.of_type
342
+ inner_type = current_type.of_type
343
343
  idx = 0
344
344
  scoped_context = context.scoped_context
345
345
  begin
@@ -351,9 +351,9 @@ module GraphQL
351
351
  set_type_at_path(next_path, inner_type)
352
352
  # This will update `response_list` with the lazy
353
353
  after_lazy(inner_value, owner: inner_type, path: next_path, scoped_context: scoped_context, field: field, owner_object: owner_object, arguments: arguments) do |inner_inner_value|
354
- continue_value = continue_value(next_path, inner_inner_value, field, inner_type.non_null?, ast_node)
354
+ continue_value = continue_value(next_path, inner_inner_value, owner_type, field, inner_type.non_null?, ast_node)
355
355
  if HALT != continue_value
356
- continue_field(next_path, continue_value, field, inner_type, ast_node, next_selections, false, owner_object, arguments)
356
+ continue_field(next_path, continue_value, owner_type, field, inner_type, ast_node, next_selections, false, owner_object, arguments)
357
357
  end
358
358
  end
359
359
  end
@@ -370,12 +370,12 @@ module GraphQL
370
370
 
371
371
  response_list
372
372
  when "NON_NULL"
373
- inner_type = type.of_type
373
+ inner_type = current_type.of_type
374
374
  # Don't `set_type_at_path` because we want the static type,
375
375
  # we're going to use that to determine whether a `nil` should be propagated or not.
376
- continue_field(path, value, field, inner_type, ast_node, next_selections, true, owner_object, arguments)
376
+ continue_field(path, value, owner_type, field, inner_type, ast_node, next_selections, true, owner_object, arguments)
377
377
  else
378
- raise "Invariant: Unhandled type kind #{type.kind} (#{type})"
378
+ raise "Invariant: Unhandled type kind #{current_type.kind} (#{current_type})"
379
379
  end
380
380
  end
381
381
 
@@ -34,8 +34,7 @@ module GraphQL
34
34
  @schema = schema
35
35
  @queries = queries
36
36
  @context = context
37
- # TODO remove support for global tracers
38
- @tracers = schema.tracers + GraphQL::Tracing.tracers + (context[:tracers] || [])
37
+ @tracers = schema.tracers + (context[:tracers] || [])
39
38
  # Support `context: {backtrace: true}`
40
39
  if context[:backtrace] && !@tracers.include?(GraphQL::Backtrace::Tracer)
41
40
  @tracers << GraphQL::Backtrace::Tracer
@@ -9,9 +9,9 @@ module GraphQL
9
9
  "query, mutation, and subscription operations."
10
10
 
11
11
  field :types, [GraphQL::Schema::LateBoundType.new("__Type")], "A list of all types supported by this server.", null: false
12
- field :queryType, GraphQL::Schema::LateBoundType.new("__Type"), "The type that query operations will be rooted at.", null: false
13
- field :mutationType, GraphQL::Schema::LateBoundType.new("__Type"), "If this server supports mutation, the type that mutation operations will be rooted at.", null: true
14
- field :subscriptionType, GraphQL::Schema::LateBoundType.new("__Type"), "If this server support subscription, the type that subscription operations will be rooted at.", null: true
12
+ field :query_type, GraphQL::Schema::LateBoundType.new("__Type"), "The type that query operations will be rooted at.", null: false
13
+ field :mutation_type, GraphQL::Schema::LateBoundType.new("__Type"), "If this server supports mutation, the type that mutation operations will be rooted at.", null: true
14
+ field :subscription_type, GraphQL::Schema::LateBoundType.new("__Type"), "If this server support subscription, the type that subscription operations will be rooted at.", null: true
15
15
  field :directives, [GraphQL::Schema::LateBoundType.new("__Directive")], "A list of all directives supported by this server.", null: false
16
16
 
17
17
  def types