Class AbstractHelper
- java.lang.Object
-
- io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
-
- Direct Known Subclasses:
ArgumentHelper,FieldHelper
public abstract class AbstractHelper extends Object
Help with the fields when fetching data.- Author:
- Phillip Kruger (phillip.kruger@redhat.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassloadingServiceclassloadingServiceprotected DefaultMapAdaptermapAdapter
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>getArrayType(Field field)protected ReflectionInvokergetReflectionInvokerForInput(AdaptWith adaptWith)protected ReflectionInvokergetReflectionInvokerForOutput(AdaptWith adaptWith)protected TransformergetTransformer(Field field)protected booleanshouldAdapt(Field field)Checks if we should adapt the field This is (for now) only applying to AdaptWithprotected booleanshouldAdaptTo(Field field)protected booleanshouldAdaptWith(Field field)protected booleanshouldAutoAdaptWithMap(Field field)protected booleanshouldTransform(Field field)Checks, if this field is a scalar and the object has the wrong type.ObjecttransformOrAdapt(Object val, Field field, graphql.schema.DataFetchingEnvironment dfe)
-
-
-
Field Detail
-
classloadingService
protected final ClassloadingService classloadingService
-
mapAdapter
protected final DefaultMapAdapter mapAdapter
-
-
Method Detail
-
shouldTransform
protected boolean shouldTransform(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(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(Field field)
-
shouldAdaptWith
protected boolean shouldAdaptWith(Field field)
-
shouldAdaptTo
protected boolean shouldAdaptTo(Field field)
-
transformOrAdapt
public Object transformOrAdapt(Object val, Field field, graphql.schema.DataFetchingEnvironment dfe) throws AbstractDataFetcherException
- Throws:
AbstractDataFetcherException
-
getTransformer
protected Transformer getTransformer(Field field)
-
getReflectionInvokerForInput
protected ReflectionInvoker getReflectionInvokerForInput(AdaptWith adaptWith)
-
getReflectionInvokerForOutput
protected ReflectionInvoker getReflectionInvokerForOutput(AdaptWith adaptWith)
-
-