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(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.transformOrAdapt(Object val, Field field, graphql.schema.DataFetchingEnvironment dfe)
-
Field Details
-
classloadingService
-
mapAdapter
-
-
Constructor Details
-
AbstractHelper
protected AbstractHelper()
-
-
Method Details
-
shouldTransform
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
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
-
shouldAdaptWith
-
shouldAdaptTo
-
transformOrAdapt
public Object transformOrAdapt(Object val, Field field, graphql.schema.DataFetchingEnvironment dfe) throws AbstractDataFetcherException - Throws:
AbstractDataFetcherException
-
getArrayType
-
getTransformer
-
getReflectionInvokerForInput
-
getReflectionInvokerForOutput
-