Class 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])
    • Constructor Detail

      • ArgumentHelper

        public ArgumentHelper​(List<Argument> arguments)
        We need the modeled arguments to create the correct values
        Parameters:
        arguments - the arguments
    • 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
      • 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 transformed
        field - the field as created while scanning
        dfe - DataFetchingEnvironment from graphql-java
        Returns:
        the value to use in the method call
        Throws:
        AbstractDataFetcherException