lib/graphql/schema/union.rb in graphql-1.13.23 vs lib/graphql/schema/union.rb in graphql-2.0.0
- old
+ new
@@ -1,10 +1,9 @@
# frozen_string_literal: true
module GraphQL
class Schema
class Union < GraphQL::Schema::Member
- extend GraphQL::Schema::Member::AcceptsDefinition
extend GraphQL::Schema::Member::HasUnresolvedTypeError
class << self
def inherited(child_class)
add_unresolved_type_error(child_class)
@@ -29,24 +28,9 @@
end
end
def all_possible_types
type_memberships.map(&:object_type)
- end
-
- prepend GraphQL::Schema::Member::CachedGraphQLDefinition::DeprecatedToGraphQL
-
- def to_graphql
- type_defn = GraphQL::UnionType.new
- type_defn.name = graphql_name
- type_defn.description = description
- type_defn.ast_node = ast_node
- type_defn.type_memberships = type_memberships
- if respond_to?(:resolve_type)
- type_defn.resolve_type = method(:resolve_type)
- end
- type_defn.metadata[:type_class] = self
- type_defn
end
def type_membership_class(membership_class = nil)
if membership_class
@type_membership_class = membership_class