Package graphql.schema
Class GraphQLTypeReference
- java.lang.Object
-
- graphql.schema.GraphQLTypeReference
-
- All Implemented Interfaces:
GraphQLInputSchemaElement,GraphQLInputType,GraphQLNamedInputType,GraphQLNamedOutputType,GraphQLNamedSchemaElement,GraphQLNamedType,GraphQLOutputType,GraphQLSchemaElement,GraphQLType
@PublicApi public class GraphQLTypeReference extends java.lang.Object implements GraphQLNamedOutputType, GraphQLNamedInputType
A special type to allow a object/interface types to reference itself. It's replaced with the real type object when the schema is built.
-
-
Constructor Summary
Constructors Constructor Description GraphQLTypeReference(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalControlaccept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)GraphQLSchemaElementcopy()Each GraphQLSchemaElement should make a copy of itself when this is called.NodegetDefinition()The ASTNodethis schema element is based on.java.lang.StringgetDescription()java.lang.StringgetName()java.lang.StringtoString()static GraphQLTypeReferencetypeRef(java.lang.String typeName)A factory method for creating type references so that when used with static imports allows more readable code such as.type(typeRef(GraphQLString))-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface graphql.schema.GraphQLSchemaElement
equals, getChildren, getChildrenWithTypeReferences, hashCode, withNewChildren
-
-
-
-
Method Detail
-
typeRef
public static GraphQLTypeReference typeRef(java.lang.String typeName)
A factory method for creating type references so that when used with static imports allows more readable code such as.type(typeRef(GraphQLString))- Parameters:
typeName- the name of the type to reference- Returns:
- a GraphQLTypeReference of that named type
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceGraphQLNamedSchemaElement- Returns:
- the name of this element. This cant be null
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceGraphQLNamedSchemaElement- Returns:
- the description of this element. This can be null
-
getDefinition
public Node getDefinition()
Description copied from interface:GraphQLNamedSchemaElementThe ASTNodethis 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 exampleGraphQLObjectType.getExtensionDefinitions()- Specified by:
getDefinitionin interfaceGraphQLNamedSchemaElement- Returns:
- Node which this element is based on. Can be null.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
- Specified by:
acceptin interfaceGraphQLSchemaElement
-
copy
public GraphQLSchemaElement copy()
Description copied from interface:GraphQLSchemaElementEach GraphQLSchemaElement should make a copy of itself when this is called. The copy should be included its current contents as they currently exist into a new object.- Specified by:
copyin interfaceGraphQLSchemaElement- Returns:
- a copy of this element
-
-