Class AbstractHelper
java.lang.Object
io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
- Direct Known Subclasses:
ArgumentHelper,FieldHelper
Help with the fields when fetching data.
- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassloadingServiceprotected final DefaultMapAdapter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Class<?> getArrayType(io.smallrye.graphql.schema.model.Field field) protected ReflectionInvokergetReflectionInvokerForInput(io.smallrye.graphql.schema.model.AdaptWith adaptWith) protected ReflectionInvokergetReflectionInvokerForOutput(io.smallrye.graphql.schema.model.AdaptWith adaptWith) protected TransformergetTransformer(io.smallrye.graphql.schema.model.Field field) protected booleanshouldAdapt(io.smallrye.graphql.schema.model.Field field) Checks if we should adapt the field This is (for now) only applying to AdaptWithprotected booleanshouldAdaptTo(io.smallrye.graphql.schema.model.Field field) protected booleanshouldAdaptWith(io.smallrye.graphql.schema.model.Field field) protected booleanshouldAutoAdaptWithMap(io.smallrye.graphql.schema.model.Field field) protected booleanshouldTransform(io.smallrye.graphql.schema.model.Field field) Checks, if this field is a scalar and the object has the wrong type.transformOrAdapt(Object val, io.smallrye.graphql.schema.model.Field field, graphql.schema.DataFetchingEnvironment dfe)
-
Field Details
-
classloadingService
-
mapAdapter
-
-
Constructor Details
-
AbstractHelper
protected AbstractHelper()
-
-
Method Details
-
shouldTransform
protected boolean shouldTransform(io.smallrye.graphql.schema.model.Field field) Checks, if this field is a scalar and the object has the wrong type. Transformation is only possible for scalars and only needed if types don't match.- Parameters:
field- the field- Returns:
- if transformation is needed
-
shouldAdapt
protected boolean shouldAdapt(io.smallrye.graphql.schema.model.Field field) Checks if we should adapt the field This is (for now) only applying to AdaptWith- Parameters:
field- the field- Returns:
- if adaption is needed
-
shouldAutoAdaptWithMap
protected boolean shouldAutoAdaptWithMap(io.smallrye.graphql.schema.model.Field field) -
shouldAdaptWith
protected boolean shouldAdaptWith(io.smallrye.graphql.schema.model.Field field) -
shouldAdaptTo
protected boolean shouldAdaptTo(io.smallrye.graphql.schema.model.Field field) -
transformOrAdapt
public Object transformOrAdapt(Object val, io.smallrye.graphql.schema.model.Field field, graphql.schema.DataFetchingEnvironment dfe) throws AbstractDataFetcherException - Throws:
AbstractDataFetcherException
-
getArrayType
-
getTransformer
-
getReflectionInvokerForInput
protected ReflectionInvoker getReflectionInvokerForInput(io.smallrye.graphql.schema.model.AdaptWith adaptWith) -
getReflectionInvokerForOutput
protected ReflectionInvoker getReflectionInvokerForOutput(io.smallrye.graphql.schema.model.AdaptWith adaptWith)
-