Is there a notion of transaction in GraphQL?

Is there a notion of transaction in GraphQL?


0

To avoid looking after a ghost, I prefer to check if the notion of a transaction can exist in GraphQL .

Let’s say I have this:

mutation save_changes {
  change01 {
    
  }
  change02 {
    
  }
}

Is there a possibility for change01 to be rolled back if change02 fails?

Share

2

  • Only commit the transaction when all operations succeed or roll it back if any of your operation fails.

    – Zoraiz Hammad

    1 hour ago

  • Are you saying that it is supported by default?

    – acmoune

    36 mins ago

1 Answer
1

Reset to default


0

GraphQL is the API technology while transaction is a DB technology. As GraphQL is agnostic to the datasource(s) used to retrieve and persist data , so it is quite normal that GraphQL does not define anything related to the DB transaction and pretty sure it will never to that in the future. It is up to the developer to implement how the transactional behaviour to be.

Share



Not the answer you're looking for? Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *