An interface for handling type conversion and creation with GraphQL. Implementations must handle circular query type creations. It is expected subsequent calls to getType, getEnumType, getMutationType, and getQueryType will return the same instance (cached).
Type Params | Return Type | Name and description |
---|---|---|
|
GraphQLTypeReference |
createReference(PersistentEntity entity, GraphQLPropertyType type) Creates a reference to domain type |
|
Builder |
getCodeRegistry() @return |
|
GraphQLType |
getEnumType(java.lang.Class<? extends java.lang.Enum> clazz, boolean nullable) Retrieves an enum type for the provided class |
|
GraphQLInputType |
getMutationType(PersistentEntity entity, GraphQLPropertyType type, boolean nullable) Retrieves a GraphQL type used for mutations that represents the provided entity |
|
GraphQLEntityNamingConvention |
getNamingConvention() @return The naming convention used to name types |
|
GraphQLOutputType |
getQueryType(PersistentEntity entity, GraphQLPropertyType type) Retrieves a GraphQL type used for queries that represents the provided entity |
|
GraphQLType |
getType(java.lang.Class clazz) Retrieves the corresponding GraphQL type for the specified class. |
|
GraphQLType |
getType(java.lang.Class clazz, boolean nullable) Retrieves the corresponding GraphQL type for the specified class. |
|
boolean |
hasType(java.lang.Class clazz) Retrieves whether or not a GraphQL type has been registered for the provided class |
|
void |
registerType(java.lang.Class clazz, GraphQLType type) Register a GraphQL type to represent the provided class |
Creates a reference to domain type
entity
- The entity to referencetype
- The type of reference
Retrieves an enum type for the provided class
clazz
- The clazz to createnullable
- True if the property allows nullsRetrieves a GraphQL type used for mutations that represents the provided entity
entity
- The persistent entity to retrieve the type fortype
- The type of property to retrievenullable
- True if the property allows nulls
Retrieves a GraphQL type used for queries that represents the provided entity
entity
- The persistent entity to retrieve the type fortype
- The type of property to retrieveRetrieves the corresponding GraphQL type for the specified class. This method should typically return a graphql.schema.GraphQLScalarType Implementations must include support for converting primitive types to their respective class types (long -> Long, byte[] -> Byte[]).
clazz
- The class to retrieve a type forRetrieves the corresponding GraphQL type for the specified class. This method should typically return a graphql.schema.GraphQLScalarType
clazz
- The class to retrieve a type fornullable
- If true, wrap the normal result with a graphql.schema.GraphQLNonNullRetrieves whether or not a GraphQL type has been registered for the provided class
clazz
- The class to search for a type forRegister a GraphQL type to represent the provided class
clazz
- The class the type representstype
- The type