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 ASTNodethis schema element is based on.getName()toString()static GraphQLTypeReferenceA 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, waitMethods 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:
getNamein interfaceGraphQLNamedSchemaElement- Returns:
- the name of this element. This cant be null
-
getDescription
- Specified by:
getDescriptionin interfaceGraphQLNamedSchemaElement- Returns:
- the description of this element. This can be null
-
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
-
accept
public TraversalControl accept(TraverserContext<GraphQLSchemaElement> context, GraphQLTypeVisitor visitor) - Specified by:
acceptin interfaceGraphQLSchemaElement
-
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
-