Closed srinivasankavitha closed 2 months ago
I don't think it was random before, it was just that DgsInputArgumentConfiguration
was getting imported before this configuration. It looks like for the Spring GraphQL configuration we import this stuff before DgsAutoConfiguration
, causing the breakage.
Yeah it wasn't random in that it was non-deterministic. It's more the fact that it happened to work because of the autoconfig order, but once we changed that we introduced new behavior which was unexpected because it's not explicit that the InputArgument resolver should always run first.
This fixes issues with resolving MultipartFile with @InputArgument.
Pull Request type
Changes in this PR
Without the ordering on InputArgumentResolver, the HandlerMethodArgumentResolverAdapter for RequestParamMethodArgumentresolver was match due to this logic: https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolver.java#L142
This breaks the use of
@InputArgument MultipartFile inputFile
in DGS data fetchers. The InputArgumentResolver handles this correctly and we should match that resolver. It was working previously prior to spring-graphql intgeration since we were getting lucky with the order.