@PublicApi public class GraphQLInterfaceType extends java.lang.Object implements GraphQLType, GraphQLOutputType, GraphQLFieldsContainer, GraphQLCompositeType, GraphQLUnmodifiedType, GraphQLNullableType, GraphQLDirectiveContainer
TypeResolver
is used to take an interface object value and decide what GraphQLObjectType
represents this interface type.
See http://graphql.org/learn/schema/#interfaces for more details on the concept.Modifier and Type | Class and Description |
---|---|
static class |
GraphQLInterfaceType.Builder |
Constructor and Description |
---|
GraphQLInterfaceType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLFieldDefinition> fieldDefinitions,
TypeResolver typeResolver)
Deprecated.
use the
newInterface() builder pattern instead, as this constructor will be made private in a future version. |
GraphQLInterfaceType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLFieldDefinition> fieldDefinitions,
TypeResolver typeResolver,
java.util.List<GraphQLDirective> directives,
InterfaceTypeDefinition definition)
Deprecated.
use the
newInterface() builder pattern instead, as this constructor will be made private in a future version. |
Modifier and Type | Method and Description |
---|---|
TraversalControl |
accept(TraverserContext<GraphQLType> context,
GraphQLTypeVisitor visitor)
Double-dispatch entry point.
|
java.util.List<GraphQLType> |
getChildren() |
InterfaceTypeDefinition |
getDefinition() |
java.lang.String |
getDescription() |
java.util.List<GraphQLDirective> |
getDirectives() |
GraphQLFieldDefinition |
getFieldDefinition(java.lang.String name) |
java.util.List<GraphQLFieldDefinition> |
getFieldDefinitions() |
java.lang.String |
getName() |
static GraphQLInterfaceType.Builder |
newInterface() |
static GraphQLInterfaceType.Builder |
newInterface(GraphQLInterfaceType existing) |
java.lang.String |
toString() |
GraphQLInterfaceType |
transform(java.util.function.Consumer<GraphQLInterfaceType.Builder> builderConsumer)
This helps you transform the current GraphQLInterfaceType 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, wait, wait, wait
getDirective, getDirectivesByName
@Deprecated public GraphQLInterfaceType(java.lang.String name, java.lang.String description, java.util.List<GraphQLFieldDefinition> fieldDefinitions, TypeResolver typeResolver)
newInterface()
builder pattern instead, as this constructor will be made private in a future version.name
- the namedescription
- the descriptionfieldDefinitions
- the fieldstypeResolver
- the type resolver function@Deprecated public GraphQLInterfaceType(java.lang.String name, java.lang.String description, java.util.List<GraphQLFieldDefinition> fieldDefinitions, TypeResolver typeResolver, java.util.List<GraphQLDirective> directives, InterfaceTypeDefinition definition)
newInterface()
builder pattern instead, as this constructor will be made private in a future version.name
- the namedescription
- the descriptionfieldDefinitions
- the fieldstypeResolver
- the type resolver functiondirectives
- the directives on this type elementdefinition
- the AST definitionpublic GraphQLFieldDefinition getFieldDefinition(java.lang.String name)
getFieldDefinition
in interface GraphQLFieldsContainer
public java.util.List<GraphQLFieldDefinition> getFieldDefinitions()
getFieldDefinitions
in interface GraphQLFieldsContainer
public java.lang.String getName()
getName
in interface GraphQLType
[_A-Za-z][_0-9A-Za-z]*
public java.lang.String getDescription()
public InterfaceTypeDefinition getDefinition()
public java.util.List<GraphQLDirective> getDirectives()
getDirectives
in interface GraphQLDirectiveContainer
public java.lang.String toString()
toString
in class java.lang.Object
public GraphQLInterfaceType transform(java.util.function.Consumer<GraphQLInterfaceType.Builder> builderConsumer)
builderConsumer
- the consumer code that will be given a builder to transformpublic TraversalControl accept(TraverserContext<GraphQLType> context, GraphQLTypeVisitor visitor)
GraphQLType
Node
, see accept(...) for more details about the pattern.accept
in interface GraphQLType
context
- TraverserContext bound to this graphQL type objectvisitor
- Visitor instance that performs actual processing on the types(s)public java.util.List<GraphQLType> getChildren()
getChildren
in interface GraphQLType
public static GraphQLInterfaceType.Builder newInterface()
public static GraphQLInterfaceType.Builder newInterface(GraphQLInterfaceType existing)