GraphQLUnionType
Implements
- GraphQLSchemaElement
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
config: Readonly<GraphQLUnionTypeConfig<any, any>>
Returns GraphQLUnionType
Properties
astNode
description
extensionASTNodes
extensions
name
resolveType
Accessors
[toStringTag]
Returns string
Methods
getTypes
Returns readonly GraphQLObjectType<any, any>[]
toConfig
Returns GraphQLUnionTypeNormalizedConfig
toJSON
Returns string
toString
Returns string
Union Type Definition
When a field can return one of a heterogeneous set of types, a Union type is used to describe what types are possible as well as providing a function to determine which type is actually used when the field is resolved.
Example: