@PublicApi public class GraphQLTypeUtil extends java.lang.Object
GraphQLType
sConstructor and Description |
---|
GraphQLTypeUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isEnum(GraphQLType type)
Returns true if the given type is an enum type
|
static boolean |
isInput(GraphQLType type)
Returns true if the given type is an input type
|
static boolean |
isLeaf(GraphQLType type)
Returns true if the given type is a leaf type, that it cant contain any more fields
|
static boolean |
isList(GraphQLType type)
Returns true if the given type is a list type
|
static boolean |
isNonNull(GraphQLType type)
Returns true if the given type is a non null type
|
static boolean |
isNotWrapped(GraphQLType type)
Returns true if the given type is NOT a non null or list type
|
static boolean |
isNullable(GraphQLType type)
Returns true if the given type is a nullable type
|
static boolean |
isScalar(GraphQLType type)
Returns true if the given type is a scalar type
|
static boolean |
isWrapped(GraphQLType type)
Returns true if the given type is a non null or list type, that is a wrapped type
|
static java.lang.String |
simplePrint(GraphQLSchemaElement schemaElement) |
static java.lang.String |
simplePrint(GraphQLType type)
This will return the type in graphql SDL format, eg [typeName!]!
|
static GraphQLUnmodifiedType |
unwrapAll(GraphQLType type)
Unwraps all layers of the type or just returns the type again if its not a wrapped type
|
static GraphQLType |
unwrapNonNull(GraphQLType type) |
static GraphQLType |
unwrapOne(GraphQLType type)
Unwraps one layer of the type or just returns the type again if its not a wrapped type
|
static java.util.Stack<GraphQLType> |
unwrapType(GraphQLType type)
graphql types can be wrapped in
GraphQLNonNull and GraphQLList type wrappers
so this method will unwrap the type down to the raw unwrapped type and return that wrapping
as a stack, with the top of the stack being the raw underling type. |
public static java.lang.String simplePrint(GraphQLType type)
type
- the type in playpublic static java.lang.String simplePrint(GraphQLSchemaElement schemaElement)
public static boolean isNonNull(GraphQLType type)
type
- the type to checkpublic static boolean isNullable(GraphQLType type)
type
- the type to checkpublic static boolean isList(GraphQLType type)
type
- the type to checkpublic static boolean isWrapped(GraphQLType type)
type
- the type to checkpublic static boolean isNotWrapped(GraphQLType type)
type
- the type to checkpublic static boolean isScalar(GraphQLType type)
type
- the type to checkpublic static boolean isEnum(GraphQLType type)
type
- the type to checkpublic static boolean isLeaf(GraphQLType type)
type
- the type to checkpublic static boolean isInput(GraphQLType type)
type
- the type to checkpublic static GraphQLType unwrapOne(GraphQLType type)
type
- the type to unwrapOnepublic static GraphQLUnmodifiedType unwrapAll(GraphQLType type)
type
- the type to unwrapOnepublic static GraphQLType unwrapNonNull(GraphQLType type)
public static java.util.Stack<GraphQLType> unwrapType(GraphQLType type)
GraphQLNonNull
and GraphQLList
type wrappers
so this method will unwrap the type down to the raw unwrapped type and return that wrapping
as a stack, with the top of the stack being the raw underling type.type
- the type to unwrap