Skip to content

Commit 89915e7

Browse files
grcooperRobert Mosolgo
andauthored
Comment for usage of graphql_name
Co-authored-by: Robert Mosolgo <rmosolgo@github.com>
1 parent 11f4870 commit 89915e7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/graphql/schema.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,8 @@ def possible_types(type = nil, context = GraphQL::Query::NullContext)
11171117
next true unless type.kind.interface?
11181118
next true unless possible_type.kind.object?
11191119

1120+
# Use `.graphql_name` comparison to match legacy vs class-based types.
1121+
# When we don't need to support legacy `.define` types, use `.include?(type)` instead.
11201122
possible_type.interfaces(context).any? { |interface| interface.graphql_name == type.graphql_name }
11211123
end if stored_possible_types
11221124
visible_possible_types ||

0 commit comments

Comments
 (0)