Unions
Union types are defined with a list of object types:
The types
array can either contain Object type names defined in SchemaTypes, or and Object Ref
created by object type. builder.objectType
, builder.objectRef
or other method, or a class that
was used to implement an object type.
The resolveType
function will be called with each item returned by a field that returns the
unionType, and is used to determine which concrete the value corresponds to. It is usually good to
have a shared property you can use to differentiate your union members.