lib/graphql/schema/union.rb in graphql-1.12.24 vs lib/graphql/schema/union.rb in graphql-1.13.0
- old
+ new
@@ -17,16 +17,21 @@
assert_valid_union_member(t)
type_memberships << type_membership_class.new(self, t, **options)
end
else
visible_types = []
+ warden = Warden.from_context(context)
type_memberships.each do |type_membership|
- if type_membership.visible?(context)
+ if warden.visible_type_membership?(type_membership, context)
visible_types << type_membership.object_type
end
end
visible_types
end
+ end
+
+ def all_possible_types
+ type_memberships.map(&:object_type)
end
def to_graphql
type_defn = GraphQL::UnionType.new
type_defn.name = graphql_name