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 (phillip.kruger@redhat.com)
  • Constructor Details

    • ArgumentHelper

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