@PublicApi public class GraphQLInterfaceType extends java.lang.Object implements GraphQLNamedType, GraphQLFieldsContainer, GraphQLCompositeType, GraphQLUnmodifiedType, GraphQLNullableType, GraphQLDirectiveContainer
At runtime a 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 |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHILD_DIRECTIVES |
static java.lang.String |
CHILD_FIELD_DEFINITIONS |
| 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. |
GraphQLInterfaceType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLFieldDefinition> fieldDefinitions,
TypeResolver typeResolver,
java.util.List<GraphQLDirective> directives,
InterfaceTypeDefinition definition,
java.util.List<InterfaceTypeExtensionDefinition> extensionDefinitions) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDirective, getDirectivesByNamepublic static final java.lang.String CHILD_FIELD_DEFINITIONS
public static final java.lang.String CHILD_DIRECTIVES
@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 GraphQLInterfaceType(java.lang.String name,
java.lang.String description,
java.util.List<GraphQLFieldDefinition> fieldDefinitions,
TypeResolver typeResolver,
java.util.List<GraphQLDirective> directives,
InterfaceTypeDefinition definition,
java.util.List<InterfaceTypeExtensionDefinition> extensionDefinitions)
public GraphQLFieldDefinition getFieldDefinition(java.lang.String name)
getFieldDefinition in interface GraphQLFieldsContainerpublic java.util.List<GraphQLFieldDefinition> getFieldDefinitions()
getFieldDefinitions in interface GraphQLFieldsContainerpublic java.lang.String getName()
getName in interface GraphQLNamedSchemaElementpublic java.lang.String getDescription()
getDescription in interface GraphQLNamedSchemaElementpublic InterfaceTypeDefinition getDefinition()
GraphQLNamedSchemaElementNode this schema element is based on. Is null if the GraphQLSchema
is not based on a SDL document.
Some elements also have additional extension Nodes. See for example GraphQLObjectType.getExtensionDefinitions()getDefinition in interface GraphQLNamedSchemaElementpublic java.util.List<InterfaceTypeExtensionDefinition> getExtensionDefinitions()
public java.util.List<GraphQLDirective> getDirectives()
getDirectives in interface GraphQLDirectiveContainerpublic java.lang.String toString()
toString in class java.lang.Objectpublic GraphQLInterfaceType transform(java.util.function.Consumer<GraphQLInterfaceType.Builder> builderConsumer)
builderConsumer - the consumer code that will be given a builder to transformpublic TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
accept in interface GraphQLSchemaElementpublic java.util.List<GraphQLSchemaElement> getChildren()
getChildren in interface GraphQLSchemaElementpublic SchemaElementChildrenContainer getChildrenWithTypeReferences()
getChildrenWithTypeReferences in interface GraphQLSchemaElementpublic GraphQLInterfaceType withNewChildren(SchemaElementChildrenContainer newChildren)
withNewChildren in interface GraphQLSchemaElementpublic static GraphQLInterfaceType.Builder newInterface()
public static GraphQLInterfaceType.Builder newInterface(GraphQLInterfaceType existing)