Custom DQL for Graphql query: How to map data of concrete types that extend an interface


I want to create Custom DQL that maps data for an object that has an edge that is an interface, but as well as mapping the data for the fields of the interface, I want to be able to map data of the concrete types that extend the interface so as to be able to do a “… on” in graphql and obtain data specific to a type. Is this possible? How would I go about it?