Package se.l4.graphql.binding.resolver
Class ResolvedGraphQLType<T extends graphql.schema.GraphQLType>
java.lang.Object
se.l4.graphql.binding.resolver.ResolvedGraphQLType<T>
public class ResolvedGraphQLType<T extends graphql.schema.GraphQLType> extends Object
Output handler as resolved by a
GraphQLOutputResolver
or a
GraphQLInputResolver
.-
Method Summary
Modifier and Type Method Description static <T extends graphql.schema.GraphQLType>
ResolvedGraphQLType<T>forType(T type)
Create a resolved result over the given type.DataFetchingConversion<?,?>
getConversion()
Conversion that can convert from an object returned by the parent field into an object that the fetchers defined bygetGraphQLType()
can act upon.DataFetchingSupplier<?>
getDefaultValue()
Get supplier that returns the default value that should be used for this type.T
getGraphQLType()
Get the defined GraphQL type.boolean
hasConversion()
Get if this type has a conversion.boolean
hasDefaultValue()
Get if a default value is present.boolean
isPresent()
Get if this output is present.static <T extends graphql.schema.GraphQLType>
ResolvedGraphQLType<T>none()
Get an instance that represents that no type was resolved.ResolvedGraphQLType<graphql.schema.GraphQLNonNull>
nonNull()
Get a version of this type that represents a non-null value.String
toString()
ResolvedGraphQLType<T>
withDefaultValue(DataFetchingSupplier<?> supplier)
Get a version of this type using the specified default value.ResolvedGraphQLType<T>
withInputConversion(DataFetchingConversion<?,?> conversion)
Get a version of this type using the specified conversion to modify the Java type.ResolvedGraphQLType<T>
withOutputConversion(DataFetchingConversion<?,?> conversion)
-
Method Details
-
none
Get an instance that represents that no type was resolved.- Returns:
- instance that always returns false from
isPresent()
-
forType
Create a resolved result over the given type.- Parameters:
type
- the GraphQL type- Returns:
- instance resolved to the specified type with no conversion
-
isPresent
public boolean isPresent()Get if this output is present.- Returns:
-
getGraphQLType
Get the defined GraphQL type.- Returns:
-
nonNull
Get a version of this type that represents a non-null value.- Returns:
-
hasConversion
public boolean hasConversion()Get if this type has a conversion.- Returns:
-
getConversion
Conversion that can convert from an object returned by the parent field into an object that the fetchers defined bygetGraphQLType()
can act upon.- Returns:
-
withInputConversion
Get a version of this type using the specified conversion to modify the Java type.- Parameters:
conversion
-
-
withOutputConversion
-
hasDefaultValue
public boolean hasDefaultValue()Get if a default value is present.- Returns:
-
getDefaultValue
Get supplier that returns the default value that should be used for this type.- Returns:
-
withDefaultValue
Get a version of this type using the specified default value.- Parameters:
supplier
-
-
toString
-