-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@BatchMapping not working for mutation response #994
Comments
I see no reason why a mutation should work differently. Is it possible to provide a basic sample? |
Agree, it is surprising. I'm not able to share a code example right now, but here is a shortened and obfuscated version of the GraphQL which demonstrates the issue: Note:
|
Thanks for the extra context, but I'm afraid it doesn't help enough. An issue of this kind is likely something less than obvious and could also be something in GraphQL Java. The best way to move forward is to provide a small sample (e.g. via https://start.spring.io) that demonstrates the issue. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
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 |
I was thinking about my scenario here and this only emerge in a very convoluted mutation result of a janky data structure... For me at least the fix is reviewing the mutation and the models and doing something that makes more sense |
Thank you for the sample. I've been able to have a closer look and found this. This DataLoader documentation page says that it works with It's worth asking in https://github.com/graphql-java/java-dataloader/discussions to see if there is any further advice on this, and if you do please link to this issue so others can find it. |
Closing for now, but we can re-open if necessary. |
Thanks @rstoyanchev. This clearly explains the current behavior and I truly appreciate the link to the docs and the code. Besides from being clear from dataloader doc you shared and the code in line 293 for GraphQL.java, it'd be good to document that dataloader does not support mutations since this is not evident. Again, many thanks. |
Fair enough, I'll re-open for a documentation update. However, it would be useful to confirm with the Dataloader team first if there isn't anything more to this. |
I added a discussion thread with the dataloader team here: |
I'm putting this on hold until we hear from the GraphQL Java team. It's clear that the combination doesn't work out of the box, but I'm not sure if it is intentional or not given that mutation execution should work like query execution. |
Understand. Great if you and others can upvote the discussion thread to encourage a response: |
I've created graphql-java/graphql-java#3711 and will close this for now, but we can re-open if necessary. |
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.The text was updated successfully, but these errors were encountered: