question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parallel execution of mutations

See original GitHub issue

Is 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:closed
  • Created 7 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelstaibcommented, Feb 8, 2023

I can confirm the issue. Still looking for the cause and why our test did not catch it.

0reactions
michaelstaibcommented, Feb 8, 2023

The issue is fixed now … we will issue a fix tonight. Thanks for reporting.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found