Parallel execution of mutations
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Product
Hot Chocolate
Describe the bug
Mutations in v13 are executed in paralled, whil GraphQL specification clearly states: https://graphql.org/learn/queries/#multiple-fields-in-mutations
While query fields are executed in parallel, mutation fields run in series, one after the other.
Steps to reproduce
Here is a minimal reproducible example.
GraphQL:
mutation {
a: do
b: do
}
Code:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGraphQLServer()
.AddQueryType<Queries>()
.AddMutationType<Mutations>();
var app = builder.Build();
app.MapGraphQL();
app.Run();
public class Mutations
{
private readonly ILogger<Mutations> _logger;
public Mutations(ILogger<Mutations> logger)
{
_logger = logger;
}
public async Task<bool> Do()
{
_logger.LogWarning("BEGIN");
await Task.Delay(100);
_logger.LogError("/END");
return true;
}
}
public class Queries
{
private readonly ILogger<Queries> _logger;
public Queries(ILogger<Queries> logger)
{
_logger = logger;
}
public async Task<bool> Get()
{
_logger.LogWarning("Q");
await Task.Delay(100);
_logger.LogError("/Q");
return true;
}
}
Relevant log output
Expected output:
BEGIN
/END
BEGIN
/END
Actual output:
BEGIN
BEGIN
/END
/END
Additional Context?
No response
Version
13.0.0
Issue Analytics
- State:
- Created 7 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Substitutions are boring: some arguments about parallel ...
Parallel mutation: A mutation that occurs at the same locus as another previous mutation, but independently from the same starting allele, ...
Read more >Are Mutations Parallel or Synchronous? - GraphQL
While query fields are executed in parallel, mutation fields run in series, one after the other. This means that if we send two...
Read more >Parallel Execution of Programs as a Support for Mutation ...
This paper shows a replication study focused on emphasizing evidence in which the use of distributed processing structures can improve mutation testing. For ......
Read more >Efficient and safe approaches to mutation in data parallelism
This type of parallel mutation relies on that different tasks mutate disjoint set of memory locations. The correctness of the above code ...
Read more >Parallel Mutant Execution Techniques in Mutation Testing ...
This paper proposes three strategies for parallel execution of mutants on multicore machines us- ing the Parallel Computing Toolbox (PCT) with the Matlab....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm the issue. Still looking for the cause and why our test did not catch it.
The issue is fixed now … we will issue a fix tonight. Thanks for reporting.