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 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 -
Method Summary
Modifier and TypeMethodDescriptionaccept
(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) copy()
Each GraphQLSchemaElement should make a copy of itself when this is called.The ASTNode
this schema element is based on.getName()
toString()
static GraphQLTypeReference
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
-
Constructor Details
-
GraphQLTypeReference
-
-
Method Details
-
typeRef
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
- Specified by:
getName
in interfaceGraphQLNamedSchemaElement
- Returns:
- the name of this element. This cant be null
-
getDescription
- Specified by:
getDescription
in interfaceGraphQLNamedSchemaElement
- Returns:
- the description of this element. This can be null
-
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
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
accept
in interfaceGraphQLSchemaElement
-
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
-