Skip to content

Commit 9dffe80

Browse files
author
Ross Cooperman
committed
Handle type resolution for interfaces
1 parent a033d60 commit 9dffe80

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/apollo-federation/entities_field.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ def _entities(representations:)
7171
# calls return the same object, it might not have the right type
7272
# Right now, apollo-federation just adds a __typename property to the result,
7373
# but I don't really like the idea of modifying the resolved object
74-
context[resolved_value] = type
74+
if type.kind == GraphQL::TypeKinds::INTERFACE
75+
context[resolved_value] = context.schema.resolve_type(type, resolved_value, context)
76+
else
77+
context[resolved_value] = type
78+
end
7579
resolved_value
7680
end
7781
end

0 commit comments

Comments
 (0)