GraphQL supports interfaces type, FastGQL allows to define interfaces in the schema and resolve them using a “type” field.
An example using interface type can be found here.