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 TraversalControl
accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
GraphQLSchemaElement
copy()
Each GraphQLSchemaElement should make a copy of itself when this is called.Node
getDefinition()
The ASTNode
this schema element is based on.java.lang.String
getDescription()
java.lang.String
getName()
java.lang.String
toString()
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))
-
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:
getName
in interfaceGraphQLNamedSchemaElement
- Returns:
- the name of this element. This cant be null
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceGraphQLNamedSchemaElement
- Returns:
- the description of this element. This can be null
-
getDefinition
public Node getDefinition()
Description copied from interface:GraphQLNamedSchemaElement
The ASTNode
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 exampleGraphQLObjectType.getExtensionDefinitions()
- Specified by:
getDefinition
in interfaceGraphQLNamedSchemaElement
- Returns:
- Node which this element is based on. Can be null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor)
- Specified by:
accept
in interfaceGraphQLSchemaElement
-
copy
public GraphQLSchemaElement copy()
Description copied from interface:GraphQLSchemaElement
Each 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:
copy
in interfaceGraphQLSchemaElement
- Returns:
- a copy of this element
-
-