GraphQLSwift / Graphiti

The Swift GraphQL Schema framework for macOS and Linux
MIT License
531 stars 67 forks source link

Mutations should run in SERIES not parallel #65

Open cshadek opened 3 years ago

cshadek commented 3 years ago

I'm running Graphiti 0.26.0 and noticed that Mutations seem to be running in parallel when they should be running in series.

A simple example would be:

mutation Test {
    addLike(input: {id: 1}) {
       ....
    }
    removeLike(input: {id: 1} ) {
       ....
    }
    addLike2: addLike(input: {id: 1} ) {
       ....
    }
}

Ideally this should run the top fields in order, per the spec, but it doesn't and it seems to run them in parallel, leading to potential race conditions and unintended results.

cshadek commented 3 years ago

@paulofaria do you have suggestions on the best way to fix this?

cshadek commented 3 years ago

This is the part of the spec that specifies that mutations should run in series.

http://spec.graphql.org/June2018/#sec-Mutation