graphql 1.13.14 → 2.0.0

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 (187) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql/analysis/ast/query_complexity.rb +1 -1
  3. data/lib/graphql/analysis/ast/query_depth.rb +0 -1
  4. data/lib/graphql/analysis/ast/visitor.rb +1 -1
  5. data/lib/graphql/analysis/ast.rb +0 -10
  6. data/lib/graphql/analysis.rb +0 -7
  7. data/lib/graphql/backtrace/table.rb +0 -18
  8. data/lib/graphql/backtrace/tracer.rb +1 -2
  9. data/lib/graphql/backtrace.rb +2 -8
  10. data/lib/graphql/dig.rb +1 -1
  11. data/lib/graphql/execution/errors.rb +1 -9
  12. data/lib/graphql/execution/interpreter/runtime.rb +2 -9
  13. data/lib/graphql/execution/interpreter.rb +0 -22
  14. data/lib/graphql/execution/lazy.rb +1 -1
  15. data/lib/graphql/execution/lookahead.rb +6 -13
  16. data/lib/graphql/execution/multiplex.rb +50 -107
  17. data/lib/graphql/execution.rb +11 -3
  18. data/lib/graphql/introspection/dynamic_fields.rb +3 -8
  19. data/lib/graphql/introspection/entry_points.rb +2 -15
  20. data/lib/graphql/language/document_from_schema_definition.rb +0 -17
  21. data/lib/graphql/pagination/connections.rb +2 -28
  22. data/lib/graphql/query/context.rb +1 -185
  23. data/lib/graphql/query/literal_input.rb +8 -13
  24. data/lib/graphql/query/validation_pipeline.rb +8 -37
  25. data/lib/graphql/query/variables.rb +22 -18
  26. data/lib/graphql/query.rb +5 -35
  27. data/lib/graphql/railtie.rb +0 -104
  28. data/lib/graphql/relay/range_add.rb +0 -4
  29. data/lib/graphql/relay.rb +0 -15
  30. data/lib/graphql/schema/addition.rb +1 -8
  31. data/lib/graphql/schema/argument.rb +1 -25
  32. data/lib/graphql/schema/build_from_definition.rb +0 -1
  33. data/lib/graphql/schema/directive.rb +0 -21
  34. data/lib/graphql/schema/enum.rb +1 -18
  35. data/lib/graphql/schema/enum_value.rb +0 -22
  36. data/lib/graphql/schema/field.rb +2 -185
  37. data/lib/graphql/schema/input_object.rb +9 -56
  38. data/lib/graphql/schema/interface.rb +0 -25
  39. data/lib/graphql/schema/introspection_system.rb +3 -8
  40. data/lib/graphql/schema/late_bound_type.rb +2 -2
  41. data/lib/graphql/schema/list.rb +0 -6
  42. data/lib/graphql/schema/loader.rb +0 -1
  43. data/lib/graphql/schema/member/base_dsl_methods.rb +0 -5
  44. data/lib/graphql/schema/member/build_type.rb +4 -6
  45. data/lib/graphql/schema/member/has_arguments.rb +14 -18
  46. data/lib/graphql/schema/member/has_fields.rb +2 -2
  47. data/lib/graphql/schema/member/has_interfaces.rb +0 -2
  48. data/lib/graphql/schema/member.rb +0 -6
  49. data/lib/graphql/schema/mutation.rb +0 -9
  50. data/lib/graphql/schema/non_null.rb +1 -7
  51. data/lib/graphql/schema/object.rb +0 -40
  52. data/lib/graphql/schema/relay_classic_mutation.rb +17 -28
  53. data/lib/graphql/schema/scalar.rb +0 -15
  54. data/lib/graphql/schema/union.rb +0 -16
  55. data/lib/graphql/schema/warden.rb +1 -1
  56. data/lib/graphql/schema/wrapper.rb +0 -5
  57. data/lib/graphql/schema.rb +106 -945
  58. data/lib/graphql/static_validation/base_visitor.rb +4 -21
  59. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -12
  60. data/lib/graphql/static_validation/validator.rb +2 -24
  61. data/lib/graphql/static_validation.rb +0 -2
  62. data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +38 -1
  63. data/lib/graphql/subscriptions/event.rb +1 -1
  64. data/lib/graphql/subscriptions/instrumentation.rb +0 -51
  65. data/lib/graphql/subscriptions.rb +4 -13
  66. data/lib/graphql/tracing/data_dog_tracing.rb +2 -19
  67. data/lib/graphql/tracing/platform_tracing.rb +4 -31
  68. data/lib/graphql/tracing.rb +0 -2
  69. data/lib/graphql/types/relay/connection_behaviors.rb +2 -6
  70. data/lib/graphql/types/relay/default_relay.rb +0 -10
  71. data/lib/graphql/types/relay/node_behaviors.rb +5 -1
  72. data/lib/graphql/types/relay.rb +0 -2
  73. data/lib/graphql/version.rb +1 -1
  74. data/lib/graphql.rb +1 -65
  75. metadata +6 -132
  76. data/lib/graphql/analysis/analyze_query.rb +0 -98
  77. data/lib/graphql/analysis/field_usage.rb +0 -45
  78. data/lib/graphql/analysis/max_query_complexity.rb +0 -26
  79. data/lib/graphql/analysis/max_query_depth.rb +0 -26
  80. data/lib/graphql/analysis/query_complexity.rb +0 -88
  81. data/lib/graphql/analysis/query_depth.rb +0 -43
  82. data/lib/graphql/analysis/reducer_state.rb +0 -48
  83. data/lib/graphql/argument.rb +0 -131
  84. data/lib/graphql/authorization.rb +0 -82
  85. data/lib/graphql/backtrace/legacy_tracer.rb +0 -56
  86. data/lib/graphql/backwards_compatibility.rb +0 -61
  87. data/lib/graphql/base_type.rb +0 -232
  88. data/lib/graphql/boolean_type.rb +0 -2
  89. data/lib/graphql/compatibility/execution_specification/counter_schema.rb +0 -53
  90. data/lib/graphql/compatibility/execution_specification/specification_schema.rb +0 -200
  91. data/lib/graphql/compatibility/execution_specification.rb +0 -436
  92. data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +0 -111
  93. data/lib/graphql/compatibility/lazy_execution_specification.rb +0 -215
  94. data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +0 -87
  95. data/lib/graphql/compatibility/query_parser_specification/query_assertions.rb +0 -79
  96. data/lib/graphql/compatibility/query_parser_specification.rb +0 -266
  97. data/lib/graphql/compatibility/schema_parser_specification.rb +0 -682
  98. data/lib/graphql/compatibility.rb +0 -5
  99. data/lib/graphql/define/assign_argument.rb +0 -12
  100. data/lib/graphql/define/assign_connection.rb +0 -13
  101. data/lib/graphql/define/assign_enum_value.rb +0 -18
  102. data/lib/graphql/define/assign_global_id_field.rb +0 -11
  103. data/lib/graphql/define/assign_mutation_function.rb +0 -34
  104. data/lib/graphql/define/assign_object_field.rb +0 -42
  105. data/lib/graphql/define/defined_object_proxy.rb +0 -53
  106. data/lib/graphql/define/instance_definable.rb +0 -255
  107. data/lib/graphql/define/no_definition_error.rb +0 -7
  108. data/lib/graphql/define/non_null_with_bang.rb +0 -16
  109. data/lib/graphql/define/type_definer.rb +0 -31
  110. data/lib/graphql/define.rb +0 -31
  111. data/lib/graphql/deprecated_dsl.rb +0 -55
  112. data/lib/graphql/directive/deprecated_directive.rb +0 -2
  113. data/lib/graphql/directive/include_directive.rb +0 -2
  114. data/lib/graphql/directive/skip_directive.rb +0 -2
  115. data/lib/graphql/directive.rb +0 -107
  116. data/lib/graphql/enum_type.rb +0 -133
  117. data/lib/graphql/execution/execute.rb +0 -333
  118. data/lib/graphql/execution/flatten.rb +0 -40
  119. data/lib/graphql/execution/typecast.rb +0 -50
  120. data/lib/graphql/field/resolve.rb +0 -59
  121. data/lib/graphql/field.rb +0 -226
  122. data/lib/graphql/float_type.rb +0 -2
  123. data/lib/graphql/function.rb +0 -128
  124. data/lib/graphql/id_type.rb +0 -2
  125. data/lib/graphql/input_object_type.rb +0 -138
  126. data/lib/graphql/int_type.rb +0 -2
  127. data/lib/graphql/interface_type.rb +0 -72
  128. data/lib/graphql/internal_representation/document.rb +0 -27
  129. data/lib/graphql/internal_representation/node.rb +0 -206
  130. data/lib/graphql/internal_representation/print.rb +0 -51
  131. data/lib/graphql/internal_representation/rewrite.rb +0 -184
  132. data/lib/graphql/internal_representation/scope.rb +0 -88
  133. data/lib/graphql/internal_representation/visit.rb +0 -36
  134. data/lib/graphql/internal_representation.rb +0 -7
  135. data/lib/graphql/list_type.rb +0 -80
  136. data/lib/graphql/non_null_type.rb +0 -71
  137. data/lib/graphql/object_type.rb +0 -130
  138. data/lib/graphql/query/arguments.rb +0 -189
  139. data/lib/graphql/query/arguments_cache.rb +0 -24
  140. data/lib/graphql/query/executor.rb +0 -52
  141. data/lib/graphql/query/serial_execution/field_resolution.rb +0 -92
  142. data/lib/graphql/query/serial_execution/operation_resolution.rb +0 -19
  143. data/lib/graphql/query/serial_execution/selection_resolution.rb +0 -23
  144. data/lib/graphql/query/serial_execution/value_resolution.rb +0 -87
  145. data/lib/graphql/query/serial_execution.rb +0 -40
  146. data/lib/graphql/relay/array_connection.rb +0 -83
  147. data/lib/graphql/relay/base_connection.rb +0 -189
  148. data/lib/graphql/relay/connection_instrumentation.rb +0 -54
  149. data/lib/graphql/relay/connection_resolve.rb +0 -43
  150. data/lib/graphql/relay/connection_type.rb +0 -54
  151. data/lib/graphql/relay/edge.rb +0 -27
  152. data/lib/graphql/relay/edge_type.rb +0 -19
  153. data/lib/graphql/relay/edges_instrumentation.rb +0 -39
  154. data/lib/graphql/relay/global_id_resolve.rb +0 -17
  155. data/lib/graphql/relay/mongo_relation_connection.rb +0 -50
  156. data/lib/graphql/relay/mutation/instrumentation.rb +0 -23
  157. data/lib/graphql/relay/mutation/resolve.rb +0 -56
  158. data/lib/graphql/relay/mutation/result.rb +0 -38
  159. data/lib/graphql/relay/mutation.rb +0 -106
  160. data/lib/graphql/relay/node.rb +0 -39
  161. data/lib/graphql/relay/page_info.rb +0 -7
  162. data/lib/graphql/relay/relation_connection.rb +0 -188
  163. data/lib/graphql/relay/type_extensions.rb +0 -32
  164. data/lib/graphql/scalar_type.rb +0 -91
  165. data/lib/graphql/schema/catchall_middleware.rb +0 -35
  166. data/lib/graphql/schema/default_parse_error.rb +0 -10
  167. data/lib/graphql/schema/default_type_error.rb +0 -17
  168. data/lib/graphql/schema/member/accepts_definition.rb +0 -164
  169. data/lib/graphql/schema/member/cached_graphql_definition.rb +0 -58
  170. data/lib/graphql/schema/member/instrumentation.rb +0 -131
  171. data/lib/graphql/schema/middleware_chain.rb +0 -82
  172. data/lib/graphql/schema/possible_types.rb +0 -44
  173. data/lib/graphql/schema/rescue_middleware.rb +0 -60
  174. data/lib/graphql/schema/timeout_middleware.rb +0 -88
  175. data/lib/graphql/schema/traversal.rb +0 -228
  176. data/lib/graphql/schema/validation.rb +0 -313
  177. data/lib/graphql/static_validation/default_visitor.rb +0 -15
  178. data/lib/graphql/static_validation/no_validate_visitor.rb +0 -10
  179. data/lib/graphql/string_type.rb +0 -2
  180. data/lib/graphql/subscriptions/subscription_root.rb +0 -76
  181. data/lib/graphql/tracing/opentelemetry_tracing.rb +0 -101
  182. data/lib/graphql/tracing/skylight_tracing.rb +0 -70
  183. data/lib/graphql/types/relay/node_field.rb +0 -24
  184. data/lib/graphql/types/relay/nodes_field.rb +0 -43
  185. data/lib/graphql/union_type.rb +0 -115
  186. data/lib/graphql/upgrader/member.rb +0 -937
  187. data/lib/graphql/upgrader/schema.rb +0 -38
@@ -35,18 +35,16 @@ module GraphQL
35
35
  else
36
36
  maybe_type = constantize(type_expr)
37
37
  case maybe_type
38
- when GraphQL::BaseType
39
- maybe_type
40
38
  when Module
41
39
  # This is a way to check that it's the right kind of module:
42
- if maybe_type.respond_to?(:graphql_definition)
40
+ if maybe_type.respond_to?(:kind)
43
41
  maybe_type
44
42
  else
45
43
  raise ArgumentError, "Unexpected class/module found for GraphQL type: #{type_expr} (must be type definition class/module)"
46
44
  end
47
45
  end
48
46
  end
49
- when GraphQL::BaseType, GraphQL::Schema::LateBoundType
47
+ when GraphQL::Schema::LateBoundType
50
48
  type_expr
51
49
  when Array
52
50
  case type_expr.length
@@ -68,7 +66,7 @@ module GraphQL
68
66
  type_expr
69
67
  when Module
70
68
  # This is a way to check that it's the right kind of module:
71
- if type_expr.respond_to?(:graphql_definition)
69
+ if type_expr.respond_to?(:kind)
72
70
  type_expr
73
71
  else
74
72
  # Eg `String` => GraphQL::Types::String
@@ -100,7 +98,7 @@ module GraphQL
100
98
 
101
99
  def to_type_name(something)
102
100
  case something
103
- when GraphQL::BaseType, GraphQL::Schema::LateBoundType
101
+ when GraphQL::Schema::LateBoundType
104
102
  something.unwrap.name
105
103
  when Array
106
104
  to_type_name(something.first)
@@ -14,7 +14,7 @@ module GraphQL
14
14
  end
15
15
 
16
16
  # @see {GraphQL::Schema::Argument#initialize} for parameters
17
- # @return [GraphQL::Schema::Argument] An instance of {arguments_class}, created from `*args`
17
+ # @return [GraphQL::Schema::Argument] An instance of {argument_class}, created from `*args`
18
18
  def argument(*args, **kwargs, &block)
19
19
  kwargs[:owner] = self
20
20
  loads = kwargs[:loads]
@@ -291,26 +291,22 @@ module GraphQL
291
291
  # This object was loaded successfully
292
292
  # and resolved to the right type,
293
293
  # now apply the `.authorized?` class method if there is one
294
- if (class_based_type = application_object_type.type_class)
295
- context.schema.after_lazy(class_based_type.authorized?(application_object, context)) do |authed|
296
- if authed
297
- application_object
294
+ context.schema.after_lazy(application_object_type.authorized?(application_object, context)) do |authed|
295
+ if authed
296
+ application_object
297
+ else
298
+ err = GraphQL::UnauthorizedError.new(
299
+ object: application_object,
300
+ type: application_object_type,
301
+ context: context,
302
+ )
303
+ if self.respond_to?(:unauthorized_object)
304
+ err.set_backtrace(caller)
305
+ unauthorized_object(err)
298
306
  else
299
- err = GraphQL::UnauthorizedError.new(
300
- object: application_object,
301
- type: class_based_type,
302
- context: context,
303
- )
304
- if self.respond_to?(:unauthorized_object)
305
- err.set_backtrace(caller)
306
- unauthorized_object(err)
307
- else
308
- raise err
309
- end
307
+ raise err
310
308
  end
311
309
  end
312
- else
313
- application_object
314
310
  end
315
311
  end
316
312
  end
@@ -103,10 +103,10 @@ module GraphQL
103
103
  end
104
104
 
105
105
  def global_id_field(field_name, **kwargs)
106
- id_resolver = GraphQL::Relay::GlobalIdResolve.new(type: self)
106
+ type = self
107
107
  field field_name, "ID", **kwargs, null: false
108
108
  define_method(field_name) do
109
- id_resolver.call(object, {}, context)
109
+ context.schema.id_from_object(object, type, context)
110
110
  end
111
111
  end
112
112
 
@@ -23,8 +23,6 @@ module GraphQL
23
23
  int.interfaces.each do |next_interface|
24
24
  implements(next_interface)
25
25
  end
26
- elsif int.is_a?(GraphQL::InterfaceType)
27
- new_memberships << int.type_membership_class.new(int, self, **options)
28
26
  elsif int.is_a?(String) || int.is_a?(GraphQL::Schema::LateBoundType)
29
27
  if options.any?
30
28
  raise ArgumentError, "`implements(...)` doesn't support options with late-loaded types yet. Remove #{options} and open an issue to request this feature."
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'graphql/schema/member/accepts_definition'
3
2
  require 'graphql/schema/member/base_dsl_methods'
4
- require 'graphql/schema/member/cached_graphql_definition'
5
3
  require 'graphql/schema/member/graphql_type_names'
6
4
  require 'graphql/schema/member/has_ast_node'
7
5
  require 'graphql/schema/member/has_directives'
@@ -14,7 +12,6 @@ require 'graphql/schema/member/relay_shortcuts'
14
12
  require 'graphql/schema/member/scoped'
15
13
  require 'graphql/schema/member/type_system_helpers'
16
14
  require 'graphql/schema/member/validates_input'
17
- require "graphql/relay/type_extensions"
18
15
 
19
16
  module GraphQL
20
17
  class Schema
@@ -24,8 +21,6 @@ module GraphQL
24
21
  # @api private
25
22
  class Member
26
23
  include GraphQLTypeNames
27
- extend CachedGraphQLDefinition
28
- extend GraphQL::Relay::TypeExtensions
29
24
  extend BaseDSLMethods
30
25
  extend BaseDSLMethods::ConfigurationExtension
31
26
  introspection(false)
@@ -41,5 +36,4 @@ end
41
36
 
42
37
  require 'graphql/schema/member/has_arguments'
43
38
  require 'graphql/schema/member/has_fields'
44
- require 'graphql/schema/member/instrumentation'
45
39
  require 'graphql/schema/member/build_type'
@@ -63,15 +63,6 @@ module GraphQL
63
63
  extend GraphQL::Schema::Resolver::HasPayloadType
64
64
 
65
65
  class << self
66
- # Override this method to handle legacy-style usages of `MyMutation.field`
67
- def field(*args, **kwargs, &block)
68
- if args.empty?
69
- raise ArgumentError, "#{name}.field is used for adding fields to this mutation. Use `mutation: #{name}` to attach this mutation instead."
70
- else
71
- super
72
- end
73
- end
74
-
75
66
  def visible?(context)
76
67
  true
77
68
  end
@@ -8,13 +8,7 @@ module GraphQL
8
8
  class NonNull < GraphQL::Schema::Wrapper
9
9
  include Schema::Member::ValidatesInput
10
10
 
11
- prepend Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
12
-
13
- def to_graphql
14
- @of_type.graphql_definition(silence_deprecation_warning: true).to_non_null_type
15
- end
16
-
17
- # @return [GraphQL::TypeKinds::NON_NULL]
11
+ # @return [GraphQL::TypeKinds::NON_NULL]
18
12
  def kind
19
13
  GraphQL::TypeKinds::NON_NULL
20
14
  end
@@ -5,7 +5,6 @@ require "graphql/query/null_context"
5
5
  module GraphQL
6
6
  class Schema
7
7
  class Object < GraphQL::Schema::Member
8
- extend GraphQL::Schema::Member::AcceptsDefinition
9
8
  extend GraphQL::Schema::Member::HasFields
10
9
  extend GraphQL::Schema::Member::HasInterfaces
11
10
 
@@ -104,45 +103,6 @@ module GraphQL
104
103
  super
105
104
  end
106
105
 
107
- # @return [Hash<String => GraphQL::Schema::Field>] All of this object's fields, indexed by name
108
- # @see get_field A faster way to find one field by name ({#fields} merges hashes of inherited fields; {#get_field} just looks up one field.)
109
- def fields(context = GraphQL::Query::NullContext)
110
- all_fields = super
111
- # This adds fields from legacy-style interfaces only.
112
- # Multi-fields are not supported here.
113
- interfaces.each do |int|
114
- if int.is_a?(GraphQL::InterfaceType)
115
- int_f = {}
116
- int.fields.each do |name, legacy_field| # rubocop:disable Development/ContextIsPassedCop -- legacy-related
117
- int_f[name] = field_class.from_options(name, field: legacy_field)
118
- end
119
- all_fields = int_f.merge(all_fields)
120
- end
121
- end
122
- all_fields
123
- end
124
-
125
- prepend Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
126
-
127
- # @return [GraphQL::ObjectType]
128
- def to_graphql
129
- obj_type = GraphQL::ObjectType.new
130
- obj_type.name = graphql_name
131
- obj_type.description = description
132
- obj_type.structural_interface_type_memberships = interface_type_memberships
133
- obj_type.introspection = introspection
134
- obj_type.mutation = mutation
135
- obj_type.ast_node = ast_node
136
- fields.each do |field_name, field_inst| # rubocop:disable Development/ContextIsPassedCop -- legacy-related
137
- field_defn = field_inst.to_graphql(silence_deprecation_warning: true)
138
- obj_type.fields[field_defn.name] = field_defn # rubocop:disable Development/ContextIsPassedCop -- legacy-related
139
- end
140
-
141
- obj_type.metadata[:type_class] = self
142
-
143
- obj_type
144
- end
145
-
146
106
  def kind
147
107
  GraphQL::TypeKinds::OBJECT
148
108
  end
@@ -29,25 +29,19 @@ module GraphQL
29
29
  # Override {GraphQL::Schema::Resolver#resolve_with_support} to
30
30
  # delete `client_mutation_id` from the kwargs.
31
31
  def resolve_with_support(**inputs)
32
- # Without the interpreter, the inputs are unwrapped by an instrumenter.
33
- # But when using the interpreter, no instrumenters are applied.
34
- if context.interpreter?
35
- input = inputs[:input].to_kwargs
36
-
37
- new_extras = field ? field.extras : []
38
- all_extras = self.class.extras + new_extras
39
-
40
- # Transfer these from the top-level hash to the
41
- # shortcutted `input:` object
42
- all_extras.each do |ext|
43
- # It's possible that the `extra` was not passed along by this point,
44
- # don't re-add it if it wasn't given here.
45
- if inputs.key?(ext)
46
- input[ext] = inputs[ext]
47
- end
32
+ input = inputs[:input].to_kwargs
33
+
34
+ new_extras = field ? field.extras : []
35
+ all_extras = self.class.extras + new_extras
36
+
37
+ # Transfer these from the top-level hash to the
38
+ # shortcutted `input:` object
39
+ all_extras.each do |ext|
40
+ # It's possible that the `extra` was not passed along by this point,
41
+ # don't re-add it if it wasn't given here.
42
+ if inputs.key?(ext)
43
+ input[ext] = inputs[ext]
48
44
  end
49
- else
50
- input = inputs
51
45
  end
52
46
 
53
47
  if input
@@ -66,17 +60,12 @@ module GraphQL
66
60
  super()
67
61
  end
68
62
 
69
- # Again, this is done by an instrumenter when using non-interpreter execution.
70
- if context.interpreter?
71
- context.schema.after_lazy(return_value) do |return_hash|
72
- # It might be an error
73
- if return_hash.is_a?(Hash)
74
- return_hash[:client_mutation_id] = client_mutation_id
75
- end
76
- return_hash
63
+ context.schema.after_lazy(return_value) do |return_hash|
64
+ # It might be an error
65
+ if return_hash.is_a?(Hash)
66
+ return_hash[:client_mutation_id] = client_mutation_id
77
67
  end
78
- else
79
- return_value
68
+ return_hash
80
69
  end
81
70
  end
82
71
 
@@ -2,7 +2,6 @@
2
2
  module GraphQL
3
3
  class Schema
4
4
  class Scalar < GraphQL::Schema::Member
5
- extend GraphQL::Schema::Member::AcceptsDefinition
6
5
  extend GraphQL::Schema::Member::ValidatesInput
7
6
 
8
7
  class << self
@@ -14,20 +13,6 @@ module GraphQL
14
13
  val
15
14
  end
16
15
 
17
- prepend Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
18
-
19
- def to_graphql
20
- type_defn = GraphQL::ScalarType.new
21
- type_defn.name = graphql_name
22
- type_defn.description = description
23
- type_defn.coerce_result = method(:coerce_result)
24
- type_defn.coerce_input = method(:coerce_input)
25
- type_defn.metadata[:type_class] = self
26
- type_defn.default_scalar = default_scalar
27
- type_defn.ast_node = ast_node
28
- type_defn
29
- end
30
-
31
16
  def kind
32
17
  GraphQL::TypeKinds::SCALAR
33
18
  end
@@ -2,7 +2,6 @@
2
2
  module GraphQL
3
3
  class Schema
4
4
  class Union < GraphQL::Schema::Member
5
- extend GraphQL::Schema::Member::AcceptsDefinition
6
5
  extend GraphQL::Schema::Member::HasUnresolvedTypeError
7
6
 
8
7
  class << self
@@ -33,21 +32,6 @@ module GraphQL
33
32
  type_memberships.map(&:object_type)
34
33
  end
35
34
 
36
- prepend GraphQL::Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
37
-
38
- def to_graphql
39
- type_defn = GraphQL::UnionType.new
40
- type_defn.name = graphql_name
41
- type_defn.description = description
42
- type_defn.ast_node = ast_node
43
- type_defn.type_memberships = type_memberships
44
- if respond_to?(:resolve_type)
45
- type_defn.resolve_type = method(:resolve_type)
46
- end
47
- type_defn.metadata[:type_class] = self
48
- type_defn
49
- end
50
-
51
35
  def type_membership_class(membership_class = nil)
52
36
  if membership_class
53
37
  @type_membership_class = membership_class
@@ -85,7 +85,7 @@ module GraphQL
85
85
  # @param context [GraphQL::Query::Context]
86
86
  # @param schema [GraphQL::Schema]
87
87
  def initialize(filter, context:, schema:)
88
- @schema = schema.interpreter? ? schema : schema.graphql_definition
88
+ @schema = schema
89
89
  # Cache these to avoid repeated hits to the inheritance chain when one isn't present
90
90
  @query = @schema.query
91
91
  @mutation = @schema.mutation
@@ -3,7 +3,6 @@
3
3
  module GraphQL
4
4
  class Schema
5
5
  class Wrapper
6
- include GraphQL::Schema::Member::CachedGraphQLDefinition
7
6
  include GraphQL::Schema::Member::TypeSystemHelpers
8
7
 
9
8
  # @return [Class, Module] The inner type of this wrapping type, the type of which one or more objects may be present.
@@ -13,10 +12,6 @@ module GraphQL
13
12
  @of_type = of_type
14
13
  end
15
14
 
16
- def to_graphql
17
- raise GraphQL::RequiredImplementationMissingError
18
- end
19
-
20
15
  def unwrap
21
16
  @of_type.unwrap
22
17
  end