graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

NodeResolver for interface types

Open tobias-tengler opened this issue 1 year ago • 0 comments

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

tobias-tengler avatar Sep 20 '22 10:09 tobias-tengler