Class ArgumentHelper
java.lang.Object
io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
io.smallrye.graphql.execution.datafetcher.helper.ArgumentHelper
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 (phillip.kruger@redhat.com)
-
Field Summary
Fields inherited from class io.smallrye.graphql.execution.datafetcher.helper.AbstractHelper
classloadingService, mapAdapter -
Constructor Summary
ConstructorsConstructorDescriptionArgumentHelper(List<Argument> arguments) We need the modeled arguments to create the correct values -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectafterRecursiveTransform(Object fieldValue, Field field, graphql.schema.DataFetchingEnvironment dfe) Here we have the potential transformed input and just need to get the correct typegetArguments(graphql.schema.DataFetchingEnvironment dfe) This gets a list of arguments that we need to all the method.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
-
Constructor Details
-
ArgumentHelper
We need the modeled arguments to create the correct values- Parameters:
arguments- the arguments
-
-
Method Details
-
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
-