Class ArgumentHelper
- java.lang.Object
-
- io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
-
- io.smallrye.graphql.execution.datafetcher.helper.ArgumentHelper
-
public class ArgumentHelper extends AbstractHelper
Help with the arguments when doing reflection calls Here we need to transform (if needed) the arguments, and then make sure we get the in the correct class type as expected by the method we want to call.- Author:
- Phillip Kruger ([email protected])
-
-
Field Summary
-
Fields inherited from class io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
classloadingService, mapAdapter
-
-
Constructor Summary
Constructors Constructor Description ArgumentHelper(List<Argument> arguments)
We need the modeled arguments to create the correct values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
afterRecursiveTransform(Object fieldValue, Field field, graphql.schema.DataFetchingEnvironment dfe)
Here we have the potential transformed input and just need to get the correct typeList<Object>
getArguments(graphql.schema.DataFetchingEnvironment dfe)
This gets a list of arguments that we need to all the method.List<Object>
getArguments(graphql.schema.DataFetchingEnvironment dfe, boolean excludeSource)
-
Methods inherited from class io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
getArrayType, getReflectionInvokerForInput, getReflectionInvokerForOutput, getTransformer, shouldAdapt, shouldAdaptTo, shouldAdaptWith, shouldAutoAdaptWithMap, shouldTransform, transformOrAdapt
-
-
-
-
Method Detail
-
getArguments
public List<Object> getArguments(graphql.schema.DataFetchingEnvironment dfe) throws AbstractDataFetcherException
This gets a list of arguments that we need to all the method. We need to make sure the arguments is in the correct class type and, if needed, transformed- Parameters:
dfe
- the Data Fetching Environment from graphql-java- Returns:
- a (ordered) List of all argument values
- Throws:
AbstractDataFetcherException
-
getArguments
public List<Object> getArguments(graphql.schema.DataFetchingEnvironment dfe, boolean excludeSource) throws AbstractDataFetcherException
- Throws:
AbstractDataFetcherException
-
afterRecursiveTransform
protected Object afterRecursiveTransform(Object fieldValue, Field field, graphql.schema.DataFetchingEnvironment dfe) throws AbstractDataFetcherException
Here we have the potential transformed input and just need to get the correct type- Parameters:
fieldValue
- the input from graphql-java, potentially transformedfield
- the field as created while scanningdfe
- DataFetchingEnvironment from graphql-java- Returns:
- the value to use in the method call
- Throws:
AbstractDataFetcherException
-
-