@PublicApi public class GraphQLUnionType extends java.lang.Object implements GraphQLType, GraphQLOutputType, GraphQLCompositeType, GraphQLUnmodifiedType, GraphQLNullableType, GraphQLDirectiveContainer
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 http://graphql.org/learn/schema/#union-types for more details on the concept.Modifier and Type | Class and Description |
---|---|
static class |
GraphQLUnionType.Builder |
Constructor and Description |
---|
GraphQLUnionType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLOutputType> types,
TypeResolver typeResolver) |
GraphQLUnionType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLOutputType> types,
TypeResolver typeResolver,
java.util.List<GraphQLDirective> directives,
UnionTypeDefinition definition) |
Modifier and Type | Method and Description |
---|---|
UnionTypeDefinition |
getDefinition() |
java.lang.String |
getDescription() |
java.util.List<GraphQLDirective> |
getDirectives() |
java.lang.String |
getName() |
TypeResolver |
getTypeResolver() |
java.util.List<GraphQLOutputType> |
getTypes() |
static GraphQLUnionType.Builder |
newUnionType() |
static GraphQLUnionType.Builder |
newUnionType(GraphQLUnionType existing) |
GraphQLUnionType |
transform(java.util.function.Consumer<GraphQLUnionType.Builder> builderConsumer)
This helps you transform the current GraphQLUnionType into another one by starting a builder with all
the current values and allows you to transform it how you want.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDirective, getDirectivesByName
public GraphQLUnionType(java.lang.String name, java.lang.String description, java.util.List<GraphQLOutputType> types, TypeResolver typeResolver)
public GraphQLUnionType(java.lang.String name, java.lang.String description, java.util.List<GraphQLOutputType> types, TypeResolver typeResolver, java.util.List<GraphQLDirective> directives, UnionTypeDefinition definition)
public java.util.List<GraphQLOutputType> getTypes()
public TypeResolver getTypeResolver()
public java.lang.String getName()
getName
in interface GraphQLType
[_A-Za-z][_0-9A-Za-z]*
public java.lang.String getDescription()
public UnionTypeDefinition getDefinition()
public java.util.List<GraphQLDirective> getDirectives()
getDirectives
in interface GraphQLDirectiveContainer
public GraphQLUnionType transform(java.util.function.Consumer<GraphQLUnionType.Builder> builderConsumer)
builderConsumer
- the consumer code that will be given a builder to transformpublic static GraphQLUnionType.Builder newUnionType()
public static GraphQLUnionType.Builder newUnionType(GraphQLUnionType existing)