spring-graphql: @BatchMapping not working for mutation response

Spring Boot 3.3.0 with Spring GraphQL v1.3.0

I have a GraphQL query and mutation that returns the same response. The response is complex with nested GraphQL types and @BatchMapping at several layers.

When I execute a mutation that will return a large number of rows in the response, it breaks. Upon investigation I see that fields marked in the controller as @BatchMapping, are not batching but running individually for each item.

When I execute a query with the exact same fragment as response and same data it works fine and I see that the fields marked as @BatchMapping works as expected by batching the data.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I added a discussion thread with the dataloader team here: Dataloader support for mutations

Hi, I also stumbled upon this bug in my project. Created a basic example here @rstoyanchev if you want to check

https://github.com/MateusDadalto/spring-batch-mapping-error