Class GraphQLUnionType

java.lang.Object
graphql.schema.GraphQLUnionType
All Implemented Interfaces:
GraphQLCompositeType, GraphQLDirectiveContainer, GraphQLNamedOutputType, GraphQLNamedSchemaElement, GraphQLNamedType, GraphQLNullableType, GraphQLOutputType, GraphQLSchemaElement, GraphQLType, GraphQLUnmodifiedType

A union type is a polymorphic type that dynamically represents one of more concrete object types.

At runtime a TypeResolver is used to take an union object value and decide what GraphQLObjectType represents this union of types.

Note that members of a union type need to be concrete object types; you can't create a union type out of interfaces or other unions.

See https://graphql.org/learn/schema/#union-types for more details on the concept.