Skip to content

Enable batching on Mutations #3737

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

Merged
merged 8 commits into from
Nov 28, 2024
Merged

Conversation

bbakerman
Copy link
Member

@bbakerman bbakerman commented Nov 2, 2024

ThisPR for the #3711 issue where mutations dont allow DataLoader delayed dispatching (rather it dispatches ALWAYS)

Mutations run in serial and hence dispatch one field at a time. However the data loader dispatching code previoiusly assumed that all of the mutation top level fields would be dispatched at once and hence it waited for all to be dispatched before it dispatched the dataloaders.

This changes that so that it expects one field at a time and it resets the tracing callstack per mutation field

@@ -228,7 +228,7 @@ private DataLoaderDispatchStrategy createDataLoaderDispatchStrategy(ExecutionCon
if (executionContext.getDataLoaderRegistry() == EMPTY_DATALOADER_REGISTRY || doNotAutomaticallyDispatchDataLoader) {
return DataLoaderDispatchStrategy.NO_OP;
}
if (executionStrategy instanceof AsyncExecutionStrategy) {
if (! executionContext.isSubscriptionOperation()) {
Copy link
Member Author

@bbakerman bbakerman Nov 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code under here then uses PerLevelDataLoaderDispatchStrategy

@bbakerman bbakerman changed the title POC - DataLoader on Mutations and Queries DataLoader on Mutations and Queries Nov 16, 2024
@bbakerman bbakerman added this to the 23.x breaking changes milestone Nov 16, 2024
@bbakerman bbakerman merged commit 7fe1826 into master Nov 28, 2024
1 check passed
@dondonz dondonz deleted the allow-dataloader-on-queries-mutations branch November 30, 2024 07:09
@dondonz dondonz changed the title DataLoader on Mutations and Queries Enable batching on Mutations Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants