graphql 1.13.6 → 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.
- checksums.yaml +4 -4
- data/lib/generators/graphql/core.rb +0 -7
- data/lib/generators/graphql/enum_generator.rb +4 -10
- data/lib/generators/graphql/field_extractor.rb +31 -0
- data/lib/generators/graphql/input_generator.rb +50 -0
- data/lib/generators/graphql/install/mutation_root_generator.rb +34 -0
- data/lib/generators/graphql/{templates → install/templates}/base_mutation.erb +0 -0
- data/lib/generators/graphql/{templates → install/templates}/mutation_type.erb +0 -0
- data/lib/generators/graphql/install_generator.rb +1 -1
- data/lib/generators/graphql/interface_generator.rb +7 -7
- data/lib/generators/graphql/mutation_create_generator.rb +22 -0
- data/lib/generators/graphql/mutation_delete_generator.rb +22 -0
- data/lib/generators/graphql/mutation_generator.rb +5 -30
- data/lib/generators/graphql/mutation_update_generator.rb +22 -0
- data/lib/generators/graphql/object_generator.rb +8 -37
- data/lib/generators/graphql/orm_mutations_base.rb +40 -0
- data/lib/generators/graphql/scalar_generator.rb +4 -2
- data/lib/generators/graphql/templates/enum.erb +5 -1
- data/lib/generators/graphql/templates/input.erb +9 -0
- data/lib/generators/graphql/templates/interface.erb +4 -2
- data/lib/generators/graphql/templates/mutation.erb +1 -1
- data/lib/generators/graphql/templates/mutation_create.erb +20 -0
- data/lib/generators/graphql/templates/mutation_delete.erb +20 -0
- data/lib/generators/graphql/templates/mutation_update.erb +21 -0
- data/lib/generators/graphql/templates/object.erb +4 -2
- data/lib/generators/graphql/templates/scalar.erb +3 -1
- data/lib/generators/graphql/templates/union.erb +4 -2
- data/lib/generators/graphql/type_generator.rb +46 -9
- data/lib/generators/graphql/union_generator.rb +5 -5
- data/lib/graphql/analysis/ast/query_complexity.rb +1 -1
- data/lib/graphql/analysis/ast/query_depth.rb +0 -1
- data/lib/graphql/analysis/ast/visitor.rb +3 -2
- data/lib/graphql/analysis/ast.rb +0 -10
- data/lib/graphql/analysis.rb +0 -7
- data/lib/graphql/backtrace/table.rb +0 -18
- data/lib/graphql/backtrace/tracer.rb +1 -2
- data/lib/graphql/backtrace.rb +2 -8
- data/lib/graphql/dataloader/source.rb +2 -2
- data/lib/graphql/dig.rb +1 -1
- data/lib/graphql/execution/errors.rb +1 -9
- data/lib/graphql/execution/interpreter/runtime.rb +2 -9
- data/lib/graphql/execution/interpreter.rb +0 -22
- data/lib/graphql/execution/lazy.rb +1 -1
- data/lib/graphql/execution/lookahead.rb +6 -13
- data/lib/graphql/execution/multiplex.rb +50 -107
- data/lib/graphql/execution.rb +11 -3
- data/lib/graphql/introspection/dynamic_fields.rb +3 -8
- data/lib/graphql/introspection/entry_points.rb +2 -15
- data/lib/graphql/introspection.rb +4 -4
- data/lib/graphql/language/document_from_schema_definition.rb +0 -17
- data/lib/graphql/pagination/connections.rb +2 -28
- data/lib/graphql/query/context.rb +1 -185
- data/lib/graphql/query/literal_input.rb +8 -13
- data/lib/graphql/query/validation_pipeline.rb +8 -37
- data/lib/graphql/query/variables.rb +22 -18
- data/lib/graphql/query.rb +5 -35
- data/lib/graphql/railtie.rb +0 -104
- data/lib/graphql/relay.rb +0 -15
- data/lib/graphql/rubocop/graphql/default_required_true.rb +4 -4
- data/lib/graphql/schema/addition.rb +1 -8
- data/lib/graphql/schema/argument.rb +18 -25
- data/lib/graphql/schema/build_from_definition.rb +0 -1
- data/lib/graphql/schema/directive.rb +4 -21
- data/lib/graphql/schema/enum.rb +1 -18
- data/lib/graphql/schema/enum_value.rb +0 -22
- data/lib/graphql/schema/field.rb +22 -194
- data/lib/graphql/schema/input_object.rb +10 -57
- data/lib/graphql/schema/interface.rb +0 -25
- data/lib/graphql/schema/introspection_system.rb +3 -8
- data/lib/graphql/schema/late_bound_type.rb +2 -2
- data/lib/graphql/schema/list.rb +0 -6
- data/lib/graphql/schema/loader.rb +0 -1
- data/lib/graphql/schema/member/base_dsl_methods.rb +0 -5
- data/lib/graphql/schema/member/build_type.rb +4 -6
- data/lib/graphql/schema/member/has_arguments.rb +14 -18
- data/lib/graphql/schema/member/has_fields.rb +2 -2
- data/lib/graphql/schema/member/has_interfaces.rb +0 -2
- data/lib/graphql/schema/member.rb +0 -6
- data/lib/graphql/schema/mutation.rb +0 -9
- data/lib/graphql/schema/non_null.rb +1 -7
- data/lib/graphql/schema/object.rb +0 -40
- data/lib/graphql/schema/relay_classic_mutation.rb +17 -28
- data/lib/graphql/schema/scalar.rb +0 -15
- data/lib/graphql/schema/union.rb +0 -16
- data/lib/graphql/schema/warden.rb +1 -1
- data/lib/graphql/schema/wrapper.rb +0 -5
- data/lib/graphql/schema.rb +107 -949
- data/lib/graphql/static_validation/base_visitor.rb +4 -21
- data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +12 -12
- data/lib/graphql/static_validation/validator.rb +2 -24
- data/lib/graphql/static_validation.rb +0 -2
- data/lib/graphql/subscriptions/default_subscription_resolve_extension.rb +38 -1
- data/lib/graphql/subscriptions/event.rb +1 -1
- data/lib/graphql/subscriptions/instrumentation.rb +0 -51
- data/lib/graphql/subscriptions.rb +4 -13
- data/lib/graphql/tracing/platform_tracing.rb +0 -23
- data/lib/graphql/tracing.rb +0 -1
- data/lib/graphql/types/iso_8601_date_time.rb +8 -1
- data/lib/graphql/types/relay/connection_behaviors.rb +4 -7
- data/lib/graphql/types/relay/default_relay.rb +0 -10
- data/lib/graphql/types/relay/node_behaviors.rb +5 -1
- data/lib/graphql/types/relay.rb +0 -2
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +12 -65
- metadata +15 -129
- data/lib/graphql/analysis/analyze_query.rb +0 -98
- data/lib/graphql/analysis/field_usage.rb +0 -45
- data/lib/graphql/analysis/max_query_complexity.rb +0 -26
- data/lib/graphql/analysis/max_query_depth.rb +0 -26
- data/lib/graphql/analysis/query_complexity.rb +0 -88
- data/lib/graphql/analysis/query_depth.rb +0 -43
- data/lib/graphql/analysis/reducer_state.rb +0 -48
- data/lib/graphql/argument.rb +0 -131
- data/lib/graphql/authorization.rb +0 -82
- data/lib/graphql/backtrace/legacy_tracer.rb +0 -56
- data/lib/graphql/backwards_compatibility.rb +0 -61
- data/lib/graphql/base_type.rb +0 -232
- data/lib/graphql/boolean_type.rb +0 -2
- data/lib/graphql/compatibility/execution_specification/counter_schema.rb +0 -53
- data/lib/graphql/compatibility/execution_specification/specification_schema.rb +0 -200
- data/lib/graphql/compatibility/execution_specification.rb +0 -436
- data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +0 -111
- data/lib/graphql/compatibility/lazy_execution_specification.rb +0 -215
- data/lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb +0 -87
- data/lib/graphql/compatibility/query_parser_specification/query_assertions.rb +0 -79
- data/lib/graphql/compatibility/query_parser_specification.rb +0 -266
- data/lib/graphql/compatibility/schema_parser_specification.rb +0 -682
- data/lib/graphql/compatibility.rb +0 -5
- data/lib/graphql/define/assign_argument.rb +0 -12
- data/lib/graphql/define/assign_connection.rb +0 -13
- data/lib/graphql/define/assign_enum_value.rb +0 -18
- data/lib/graphql/define/assign_global_id_field.rb +0 -11
- data/lib/graphql/define/assign_mutation_function.rb +0 -34
- data/lib/graphql/define/assign_object_field.rb +0 -42
- data/lib/graphql/define/defined_object_proxy.rb +0 -53
- data/lib/graphql/define/instance_definable.rb +0 -240
- data/lib/graphql/define/no_definition_error.rb +0 -7
- data/lib/graphql/define/non_null_with_bang.rb +0 -16
- data/lib/graphql/define/type_definer.rb +0 -31
- data/lib/graphql/define.rb +0 -31
- data/lib/graphql/deprecated_dsl.rb +0 -55
- data/lib/graphql/directive/deprecated_directive.rb +0 -2
- data/lib/graphql/directive/include_directive.rb +0 -2
- data/lib/graphql/directive/skip_directive.rb +0 -2
- data/lib/graphql/directive.rb +0 -107
- data/lib/graphql/enum_type.rb +0 -133
- data/lib/graphql/execution/execute.rb +0 -333
- data/lib/graphql/execution/flatten.rb +0 -40
- data/lib/graphql/execution/typecast.rb +0 -50
- data/lib/graphql/field/resolve.rb +0 -59
- data/lib/graphql/field.rb +0 -226
- data/lib/graphql/float_type.rb +0 -2
- data/lib/graphql/function.rb +0 -128
- data/lib/graphql/id_type.rb +0 -2
- data/lib/graphql/input_object_type.rb +0 -138
- data/lib/graphql/int_type.rb +0 -2
- data/lib/graphql/interface_type.rb +0 -72
- data/lib/graphql/internal_representation/document.rb +0 -27
- data/lib/graphql/internal_representation/node.rb +0 -206
- data/lib/graphql/internal_representation/print.rb +0 -51
- data/lib/graphql/internal_representation/rewrite.rb +0 -184
- data/lib/graphql/internal_representation/scope.rb +0 -88
- data/lib/graphql/internal_representation/visit.rb +0 -36
- data/lib/graphql/internal_representation.rb +0 -7
- data/lib/graphql/list_type.rb +0 -80
- data/lib/graphql/non_null_type.rb +0 -71
- data/lib/graphql/object_type.rb +0 -130
- data/lib/graphql/query/arguments.rb +0 -189
- data/lib/graphql/query/arguments_cache.rb +0 -24
- data/lib/graphql/query/executor.rb +0 -52
- data/lib/graphql/query/serial_execution/field_resolution.rb +0 -92
- data/lib/graphql/query/serial_execution/operation_resolution.rb +0 -19
- data/lib/graphql/query/serial_execution/selection_resolution.rb +0 -23
- data/lib/graphql/query/serial_execution/value_resolution.rb +0 -87
- data/lib/graphql/query/serial_execution.rb +0 -40
- data/lib/graphql/relay/array_connection.rb +0 -83
- data/lib/graphql/relay/base_connection.rb +0 -189
- data/lib/graphql/relay/connection_instrumentation.rb +0 -54
- data/lib/graphql/relay/connection_resolve.rb +0 -43
- data/lib/graphql/relay/connection_type.rb +0 -41
- data/lib/graphql/relay/edge.rb +0 -27
- data/lib/graphql/relay/edge_type.rb +0 -19
- data/lib/graphql/relay/edges_instrumentation.rb +0 -39
- data/lib/graphql/relay/global_id_resolve.rb +0 -18
- data/lib/graphql/relay/mongo_relation_connection.rb +0 -50
- data/lib/graphql/relay/mutation/instrumentation.rb +0 -23
- data/lib/graphql/relay/mutation/resolve.rb +0 -56
- data/lib/graphql/relay/mutation/result.rb +0 -38
- data/lib/graphql/relay/mutation.rb +0 -106
- data/lib/graphql/relay/node.rb +0 -39
- data/lib/graphql/relay/page_info.rb +0 -7
- data/lib/graphql/relay/relation_connection.rb +0 -188
- data/lib/graphql/relay/type_extensions.rb +0 -32
- data/lib/graphql/scalar_type.rb +0 -91
- data/lib/graphql/schema/catchall_middleware.rb +0 -35
- data/lib/graphql/schema/default_parse_error.rb +0 -10
- data/lib/graphql/schema/default_type_error.rb +0 -17
- data/lib/graphql/schema/member/accepts_definition.rb +0 -164
- data/lib/graphql/schema/member/cached_graphql_definition.rb +0 -58
- data/lib/graphql/schema/member/instrumentation.rb +0 -131
- data/lib/graphql/schema/middleware_chain.rb +0 -82
- data/lib/graphql/schema/possible_types.rb +0 -44
- data/lib/graphql/schema/rescue_middleware.rb +0 -60
- data/lib/graphql/schema/timeout_middleware.rb +0 -88
- data/lib/graphql/schema/traversal.rb +0 -228
- data/lib/graphql/schema/validation.rb +0 -313
- data/lib/graphql/static_validation/default_visitor.rb +0 -15
- data/lib/graphql/static_validation/no_validate_visitor.rb +0 -10
- data/lib/graphql/string_type.rb +0 -2
- data/lib/graphql/subscriptions/subscription_root.rb +0 -76
- data/lib/graphql/tracing/skylight_tracing.rb +0 -70
- data/lib/graphql/types/relay/node_field.rb +0 -24
- data/lib/graphql/types/relay/nodes_field.rb +0 -43
- data/lib/graphql/union_type.rb +0 -115
- data/lib/graphql/upgrader/member.rb +0 -937
- data/lib/graphql/upgrader/schema.rb +0 -38
@@ -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
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
#
|
41
|
-
#
|
42
|
-
|
43
|
-
|
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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
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
|
data/lib/graphql/schema/union.rb
CHANGED
@@ -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
|
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
|