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 ([email protected])
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassloadingService
classloadingService
protected DefaultMapAdapter
mapAdapter
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Class<?>
getArrayType(Field field)
protected ReflectionInvoker
getReflectionInvokerForInput(AdaptWith adaptWith)
protected ReflectionInvoker
getReflectionInvokerForOutput(AdaptWith adaptWith)
protected Transformer
getTransformer(Field field)
protected boolean
shouldAdapt(Field field)
Checks if we should adapt the field This is (for now) only applying to AdaptWithprotected boolean
shouldAdaptTo(Field field)
protected boolean
shouldAdaptWith(Field field)
protected boolean
shouldAutoAdaptWithMap(Field field)
protected boolean
shouldTransform(Field field)
Checks, if this field is a scalar and the object has the wrong type.Object
transformOrAdapt(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)
-
-