Skip to content

Commit

Permalink
Handle type resolution for interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Cooperman committed Oct 6, 2023
1 parent a033d60 commit 9dffe80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/apollo-federation/entities_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def _entities(representations:)
# calls return the same object, it might not have the right type
# Right now, apollo-federation just adds a __typename property to the result,
# but I don't really like the idea of modifying the resolved object
context[resolved_value] = type
if type.kind == GraphQL::TypeKinds::INTERFACE
context[resolved_value] = context.schema.resolve_type(type, resolved_value, context)
else
context[resolved_value] = type
end
resolved_value
end
end
Expand Down

0 comments on commit 9dffe80

Please sign in to comment.