graphql-platform
graphql-platform copied to clipboard
Support for Apollo Federation @interfaceObject
Product
Hot Chocolate
Is your feature request related to a problem?
Apollo Federation has introduced @interfaceObject which isn't supported in HotChocolate.ApolloFederation package. This is an import feature that not only reduces code duplication in subgraphs, but also help us provide capability to resolve a external interface reference in a polymorphic manner
The solution you'd like
Please add support for @interfaceObject and support resolving interface object type in subgraphs
I just ran across this today, and the overall issue I believe is not supporting Apollo Federation 2.0.
I wrote my own interfaceObject directive, and it was output in the schema, but then rover refused to merge the graphs because the one from HotChocolate didn't have a @link directive specifying it was using v2.0
@darren-clark , Also we need the entity resolver to be able to resolve on the interface type which i don't think it's supported atm
It isn't. I fiddled a bit today to see if I could get something working with manually created schema for federation. Specifically trying to get an entity resolve for an interface to work.
I was able to get it to call a resolver for a base class.
However even though the resolver returned a derived class, the response from HotChocolate was empty.
Probably because the query was ... on BaseInterface { __typename field } and the resolver returned DerivedImplementation so they got removed.
@michaelstaib I believe this is already supported so should this be closed?
@dariuszkuc interface object is supported but there is no way to add reference resolvers on interfaces. So, technically you can make it work if the subgraph where the actual interface is defined isn't using Hot Chocolate.