Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Banana Cake Pop the awesome Monaco based GraphQL IDE.
I have an interface type with two implementing object types. Both object types refer to the same entity, so they share the same Id. This Id is also part of the aforementioned interface.
Other object types have properties referencing these Ids. Since a global Id must be unique for a type, these properties referencing the interface type can not point to a concrete implementation. They have to be serialized for the interface type. This works fine.
The problem is with object identification. I currently have no way to specify a node resolver for an interface type. So I can't fetch the interface type through the node(s) field.
The solution you'd like
The global object identification spec speaks of identifying objects, but it's never explicitly said that an object must be an object type.
I think the best solution would be to allow to define a node resolver for an interface type.
Having now the same issue but then on input types, where you cannot receive IDs for an interface type with the [property: ID(nameof(InterfaceType))] attribute.
Is your feature request related to a problem?
I have an interface type with two implementing object types. Both object types refer to the same entity, so they share the same Id. This Id is also part of the aforementioned interface. Other object types have properties referencing these Ids. Since a global Id must be unique for a type, these properties referencing the interface type can not point to a concrete implementation. They have to be serialized for the interface type. This works fine.
The problem is with object identification. I currently have no way to specify a node resolver for an interface type. So I can't fetch the interface type through the node(s) field.
The solution you'd like
The global object identification spec speaks of identifying objects, but it's never explicitly said that an object must be an object type.
I think the best solution would be to allow to define a node resolver for an interface type.
Product
Hot Chocolate