public List<GraphQLArgument> buildGraphQLArgumentsFromMethodParams(DfsContext dfsContext, Method method, Class<?> implClass) { List<GraphQLArgument> graphQLArguments = new ArrayList<>(); final GraphQLMethodParameters graphQLMethodParameters = new GraphQLMethodParameters(method, implClass); if (graphQLMethodParameters.hasParameters()) { graphQLMethodParameters.getParameters().forEach(mpi -> { Object defaultValue = invokeMethodByName(dfsContext, implClass, mpi.getGraphQLInDefaultValueProviderMethodName()); defaultValue = evaluateSpElExpression(dfsContext, implClass, null, mpi.getGraphQLInDefaultValueSpel(), defaultValue); if (mpi.isValidGraphQLInParameter()) { GraphQLArgument graphQLArgument = newArgument() .name(mpi.getName()) .description(mpi.getDescription()) .type(buildGraphQLInputTypeFromMethodParam(dfsContext, mpi.getResolvableTypeAccessor())) .defaultValue(defaultValue) .build(); graphQLArguments.add(graphQLArgument); } }); } return graphQLArguments; }
graphQLMethodParameters.getParameters().forEach(mpi -> { if (mpi.isValidGraphQLInParameter()) { GraphQLInputType graphQLInputType = buildGraphQLInputTypeFromMethodParam(dfsContext, mpi.getResolvableTypeAccessor()); if (graphQLInputType != null) { graphQLInputType = mpi.isRequired() ? new GraphQLNonNull(graphQLInputType) : graphQLInputType;
public String getGraphQLInDefaultValueProviderMethodName() { return getResolvableTypeAccessor().getGraphQLInDefaultValueProviderMethodName(); }
public String getDescription() { return getResolvableTypeAccessor().getDescription(); }
public boolean isGraphQLInParameter() { return getResolvableTypeAccessor().isGraphQLInParameter(); }
public String getGraphQLInDefaultValueSpel() { return getResolvableTypeAccessor().getGraphQLInDefaultValueSpel(); }
public Class<?> getParameterType() { return getResolvableTypeAccessor().getActualType(); }
public boolean isCollectionLike() { return getResolvableTypeAccessor().isCollectionLike(); }
public Class<?> getRawType() { return getResolvableTypeAccessor().resolve(); }